In simple terms, you can use JavaScript, but the method I suggest is different from that on the upstairs. I suggest directly calling the "server"
Client script function corresponding to the client event. For pages automatically output by Asp.net, there will be
Function _ dopostback (eventtarget, eventargument), you should use this function directly
PostBack (for example, _ dopostback ('button1', ''). Then the server can directly identify this PostBack as a pair
Event.
To be more complex, you can encapsulate this JavaScript code into your own server components. It is different from directly passing an event to the target control.
You need to define an event for your server control, and define in the page logic when your server control triggers this event,
Events that automatically trigger the target control. For example, You encapsulate a mywebcontrol and modify the client script
_ Dopostback ('mywebcontrol1 ', ''). Then, your mywebcontrol needs to write and capture this PostBack and generate the corresponding
Event code.
Place a button on the page, trigger the button with a script, and add the process to be processed in the Event Response Process of the button;
Document. Forms (0). Button. Click ();
Textboxname. Attributes. Add ("onmouseover", "This. Focus ()");
Textboxname. Attributes. Add ("onfocus", "This. Select ()");
. CS
Textbox3.attributes. Add ("onblur", "javascript: Check ();");
. Html
Function check ()
{
S = Document. All ("textbox3"). value;
S = parseint (s );
Document. All ("textbox3"). value = s;
}
<Script language = "JavaScript">
Function check ()
{
VaR;
S = Document. All ("textbox3"). value;
// S = parseint (S, 2 );
If (S. indexof (".") = "-1 ")
S = S + ". 00"
Else
{A = S. Split (".");
If (A [1]. Length = 1)
S = A [0] + "." + A [1] + "0 ";
}
Document. All ("textbox3"). value = s;
}
</SCRIPT>