How to Disable Browser Back and Forward button

To disable the Browser's buttons do not makes any sense.

If you will open a new browser window on click event, you can hide the buttons but the user can still navigate with the keyboard. If you can able to disable the keyboard keys for Back and Forward Navigation, then still its not sure that it will work with every browser.

So Better to handle this problem by Coding in Vb or C#.A better approach is to disable caching so  the page must be requested
fresh each time from Server.

Use this code on Page_Load event of the page.
Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")

So whenever the Page_Load event occures, it will ask a new copy from server, so that we can write code which will check that wheather the request is valid or not. This Condition is depend on your application requirment. 

To Disable Back and Forward Navigation of Browser follwing is the Script

<head> <script language="JavaScript" type="text/javascript">

javascript:window.history.forward(1);

</script> </head>

But i should not recommand you to use this JavaScript, Because if the JavaScript is Disable in the Browser, then your code will not work.

Ebook Download
View all
Learn
View all