[ASP.NET] [Original] How to call the server code in the client, such as 3 TEXTBOXs we have on the page, 3 Button, each Button performs different actions. We now want to detect if you press the Enter key in TextBox, if you do different Button calls. That is, press it in TextBox1 to execute the action of Button1, ......
In the test, I found that the server-side code must call the __dopostback function, but this function does not except that the information is generated by the system in the page placed in the page placed in the DataGrid control. (You can see the code by viewing the source file). This way we must hand in the ASPX to add the __dopostback function, and the functions added together have two hidden elements, __ evenettarget, and __eventargument, this is necessary, in fact, .NET is the element name of the event and Parameters are transmitted to, __ evenettarget and __eventargument. Then call the Submit function of the Form to submit back to the server, the server side knows which control is triggered according to the passing parameters, thus calling its corresponding backend code, and then send the new page back to the client. The following is my test page, which use two ways to detect buttons in TextBox Webform2.aspx --------------------------------------------------------------------------- ---------------------------- <% @ page language = "c #" codebehind = "Webform2.aspx.cs" autoeventwireup = "false "Inherits =" UTF8TEST.WEBFORM2 "%>