In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article introduces the relevant knowledge of "how to use Enter Key as the default to submit questions in ASP.NET2.0". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
One of the most annoying things in web development is dealing with "Enter key" for forms, and "Enter key" has become a preference for users to submit forms. Although we provide users with a submit button, the simplest and most direct way is to enter text and then enter to complete the submission.
ASP.NET 2.0 provides a good solution to this. You just need to specify the "defaultbutton" property to the ID of the button control that you want to raise the event.
"defaultbutton" can be specified at both the form level and the panel level (tags). When defaultbutton is specified in both the form and the panel, if "Enter key" is triggered in the panel, execute the
The following example code has a form and four panels, with buttons in both the report and the panel. Attention: the event of which buttons will be triggered after you enter in the text box
/ The corresponding, sample events for the button clicks areprotected void Button1_Click (object sender, EventArgs e) {Response.Write (Button1.Text);} protected void Button2_Click (object sender, EventArgs e) {Response.Write (Button2.Text);} protected void Button3_Click (object sender, EventArgs e) {Response.Write (Button3.Text);} protected void Button4_Click (object sender, EventArgs e) {Response.Write (Button4.Text);} protected void btn1_Click (object sender, EventArgs e) {Response.Write (btn1.Text) } protected void Button5_Click (object sender, EventArgs e) {Response.Write (Button5.Text);} "how to use Enter Key as the default to submit questions in ASP.NET2.0" ends here. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.