Friday, 6 December 2013
How to disable back button in browser
Add onload="noBack();" onpageshow="if (event.persisted) noBack();" on body tag.
Example :
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body onload="noBack();" onpageshow="if (event.persisted) noBack();">
<form id="form1" runat="server" >
<div>
login name : <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <br />
password :<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> <br />
<asp:Button ID="Button1" runat="server" Text="ok" />
</div>
</form>
</body>
</html>
Example :
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body onload="noBack();" onpageshow="if (event.persisted) noBack();">
<form id="form1" runat="server" >
<div>
login name : <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <br />
password :<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> <br />
<asp:Button ID="Button1" runat="server" Text="ok" />
</div>
</form>
</body>
</html>
0 comments:
Post a Comment