[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, pressing the back to the bus in TEXTBOX1 to perform the action of Button1, ... Test, I found that the server-side code must call the __dopostback function, but the function is in addition to the system in the page placed with the DataGrid control. Outside, other pages do not exist. (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 "%>