Event | Description | Applicable on Controls |
onAbort | When user cancel image loading | Image |
onBlur | When control lost its Focus | Button, Checkbox, FileUpload, Layer, Password, Radio, Reset, Select, Submit, Text, TextArea, Window |
onChange | Combo index change/Textbox data change | Text, TextArea, Select |
onClick | Most useful event. Occur when user click on a button | Button, Checkbox, Link, Radio, Submit |
onDblClick | When user double click on a Link | Link |
onFocus | When an object get focus | Button, Checkbox, Radio, Reset, Select, Submit, Text, TextArea |
onKeyDown | When the key is down means pressing time | Link, TextArea |
onKeyPress | When user presses/holds a key | Link, TextArea |
onKeyUp | When user release a key | Link, TextArea |
onLoad | After completion of loading a page | Window, Image |
onMouseDown | When mouse presses | Link, Button, Document |
onMouseMove | When user moves the mouse | Link, Button, Document |
onMouseOut | When user moves the mouse away from a object | Image, Link |
onMouseOver | When user moves the mouse over a object | Image, Link |
onMouseUp | When user release mouse | Document, Button, Link |
onMove | When user moves the browser window or a frame | Document, Button, Link |
onReset | By clicking on reset Button | Form |
onResize | When user resizes the browser window or a frame | Window |
onSelect | When user select text | Text, TextArea |
onSubmit | When user clicks the submit button | Form |
onUnload | When user leaves the page/close the browser | Window |
Example onClick Event:
function clck()
{
// Code goes here
alert("Click event fired");
// Return false never make a post back to server.
// so one can add validation by using this concept. If return true then the page will be post back to server
return false;
}
Add the handler:
<asp:button runat="server" id="cmdOnClick" text="OnClientClick" onclientclick="return clck();">
<asp:button runat="server" id="cmdOnClick" text="OnClientClick" onclientclick="return clck();">
<input type="button" name="cmdHTML" value="HTML onClick" onclick="return clck();">
<asp:button runat="server" id="cmdOnClick" text="OnClientClick" onclientclick="return clck();">
<input type="button" name="cmdHTML" value="HTML onClick" onclick="return clck();">
No comments:
Post a Comment