ASP.NET is divided into two cases in the client trigger server event:
I. Type in the Button and HtmlControls in WebControls is Submit's HTMLINPUTBUTTON
These two buttons finally go to the client's performance form:
IMAGEBUTTON or HTTPINPUTIMAGE:
These controls to the client's performance is similar to this: , click on such a control to submit a form directly, and the same commit button. The parameter that clicks on such controls to the server is like this: id.x = nn & id.y = nn, corresponding to the above example is: img1.x = nn & img1.y = nn
III. Type in HTMLControls is Button's HTMLINPUTBUTTON and all other control events, such as LinkButton Click, TextBox Change Events, etc.:
These events are sent to the server after the client is generated.
1. First ASP.NET Page Framework uses two Hidden domains to store events that are triggered by which controls are triggered, as well as the parameters of the event:
2. The server generates a JScript method to handle all of these events, this code is:
Function __dopostback (evenettarget, eventargument) {
Var theform = document.Webform2;
Theform .__ evenettarget.value = eventtarget;
Theform .__ Eventargument.Value = Eventargument
Theform.submit ();
}
// ->
script>
3. Each control that will trigger a server event calls the above code in the response client event:
For example, Type in HTMLControls is the click event of Button's HTMLINPUTBUTTON.
Another example, the Change event of the TextBox control
4. The client triggered the event, call the __dopostback method, pay the EventTarget and event parameters of the triggered control source to two hidden domains __EventTarget and __Eventargument, then submit Formentargument, based on __EventTarget and __Eventargument To determine which control is triggered.