Attributes. Add ("javascript event", "javascript statement ");
For example:
This. textbox1.attributes. Add ("onblue", "window. label1.style. backgroundcolor = '#000000 ';");
This. textbox1.attributes. Add ("onblur", "This. style. Display = 'none '");
Javascript events:
Onclick: Click an event.
Ondblclick double-click event
The button on the onmousedown mouse is pressed
Events triggered when the onmouseup mouse is pressed and released
Onmouseover event triggered when the mouse moves over an object range
Event triggered when the onmousemove mouse moves
Onmouseout event triggered when the mouse leaves an object range
Onkeypress events triggered when a key on the keyboard is pressed and released. [Note: the page must contain focused objects]
Onkeydown events triggered when a key on the keyboard is pressed [NOTE: The page must contain focused objects]
Onkeyup events triggered when a button on the keyboard is pressed and opened [NOTE: The page must contain focused objects]
Attributes. after adding add, a certain speed will be affected. attributes and attributes. after cssstyle is automatically saved to viewstate, the load viewstate burden increases at the time of PostBack, in addition to the sudden increase in viewstate volume.
Add the following event in the following format:
Protected override void render (htmltextwriter output)
{
This. attributes ["ABC"] = "123 ";
This. Attributes. cssstyle ["ABC-style"] = "123-style ";
Output. Write (text );
}
Attributes and attributes. cssstyle will no longer be saved to viewstate.