Disable the back button.
You ever need to perform some function in Javascript (like submitting a form?) that afterword, if the user were to hit the back button, it would cause big problems? A lot of times this can be solved by just throwing a little more Javascript on the page. Perticularly this little snippet:
history.forward();
That should do ya. It really doesn't disable the back button, but if you put that on the top of your page the page will stop processing and send the user back to where they came from (only when the back button is clicked, since there is no forward history the first time you come to the page).

Comments
http:// on on 8.03.2004 at 7:16 AM
thank u very much
http:// on on 8.27.2004 at 1:20 PM
This code will disable the back button of the browser
<script>
history.forward();
</script>
rubencho on on 9.25.2004 at 11:54 PM
Sorry,
Where exactly put this code?
I'm working with Asp.Net.
http:// on on 10.27.2004 at 7:17 PM
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
StringBuilder sb = new StringBuilder();
sb.Append("<script language=javascript>\n");
sb.Append("window.history.forward(1);\n");
sb.Append("\n</script>");
Page.RegisterClientScriptBlock("clientScript",sb.ToString());
}
http:// on on 3.11.2005 at 3:57 PM
how can i disable the back button in .net applications