ASP. NET:
If there is only one text field, press enter to submit it. The Webserver buttonx_click cannot be intercepted and can only be intercepted in page_load on the webserver, it's no different from submitting a traditional web form to action CGI!
If there is more than one field of the text type, press enter to submit it. You can intercept the webserver buttonx_click field!
Test. aspx
<HTML>
<Script language = "C #" runat = Server>
Void button#click (Object sender, eventargs E)
{
// If there is only one text field, press enter to submit it. The Webserver buttonx_click cannot be intercepted.
Label1.text = "you entered:" + textbox1.text;
}
Void page_load (Object sender, eventargs E)
{
// If there is only one field of the text type, press enter to submit it. The Webserver buttonx_click cannot be intercepted and can only be intercepted in page_load of the webserver.
// Button#click (null, null );
}
</SCRIPT>
<Body>
<Form runat = "server" enableviewstate = "false">
ASP. NET:
<Br> if there is only one text field, press enter to submit it. The Webserver buttonx_click cannot be intercepted and can only be intercepted in page_load on the webserver: <br>
ASP: textbox1: <br>
<Asp: textbox id = "textbox1" runat = "server" text = "ASP: textbox "/> after entering the information, press enter to submit. Note that the effect is different from that of clicking the submit button. <br>
If the following text fields are removed and only one text field exists, press enter to submit the fields, and the webserver buttonx_click cannot be intercepted, it can only be "intercepted" in page_load on webserver! It is no different from the traditional web form action CGI <br>
If there are more than one field of the text type, press enter to submit, and the webserver buttonx_click can be intercepted. <br>
HTML form input: <br>
<Input type = "text" value = "HTML input" Disabled = "disabled">
<Asp: button id = "button1" text = "Submit" onclick = "button#click" runat = "server"/>
<Br>
<Asp: Label id = "label1" runat = "server"/>
</Form>
</Body>
</Html>