alert("Hello".length);
<asp:Button ID="Button2" runat="server" Text="Button" OnClientClick="fire_button_event();" /> <script type="text/javascript"> function fire_button_event() { alert('button click event fired'); } </script>
Button1.Attributes.Add("onclick", "js function();");
<asp:CheckBox ID="CheckBox1" runat="server" Text="Yes" OnCheckedChanged="CheckBox1_CheckedChanged"/> protected void CheckBox1_CheckedChanged(object sender, EventArgs e) { //write your code }
<asp:CheckBox ID="CheckBox2" runat="server" Text="Yes" onclick="js_function();"/>
<asp:CheckBox ID="chkbox_yes" runat="server" Text="Yes" TextAlign="Left"/>
document.getElementById("div1").style.borderColor = "green"; document.getElementById("btn_save").style.borderColor = "blue";
<script type="text/javascript" language="javascript"> function disable_browser_back_button() { window.history.forward(); } </script> And call above function on Body Onload event as <body onload="disable_browser_back_button();">
<script type="text/javascript" language="javascript"> function disable_browser_buttons() { window.history.forward(1); } </script> <body onload="disable_browser_buttons();">
function prevent_submission() { return (event.keyCode!=13); } <asp:TextBox ID="txt_emp_first_name" runat="server" onkeydown = "prevent_submission();"></asp:TextBox>
<script type="text/javascript"> function TestFunction(){ alert(location.href); location.href="http://www.google.com"; } </script> <input type="Button" id="btntest" onclick="TestFunction()" value="clickme"
<script type="text/javascript"> function confirmMe() { var v = confirm("Are you sure to confirm?"); if (v) { //ok pressed; user confirmed to proceed further //write code to execute code alert("Go ahead"); } else { //cancel pressed; user don't want to proceed alert("Stop") } } </script>
<input type="button" onclick="confirmMe()" />