Click here to Skip to main content
15,893,722 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have an aspx page that add some details and redirect to another page but when i click on back button in internet explorer it shows that added detail, so i want to disable that back button OR when i click on back button in internet explorer then it should be remain on that page
Posted
Comments
Member 10426038 2-Jun-14 4:42am    
search on google before posting your Question :D

There is no sure way of doing this - because all browsers are different and scripting languages work slightly differently on all of them.

Some http://viralpatel.net/blogs/2009/11/disable-back-button-browser-javascript.html help you achieve this - but then, there is no certainty that these will work.

Some other approaches are discussed at Disabling the Back Button[^].
 
Share this answer
 
C#
protected void Page_Load(object sender, EventArgs e)
      {
          Context.Request.Browser.Adapters.Clear();
          Response.Cache.SetExpires(DateTime.Parse(DateTime.Now.ToString()));
          Response.Cache.SetCacheability(HttpCacheability.Private);
          Response.Cache.SetNoStore();
          Response.AppendHeader("Pragma", "no-cache");

      }

add this in your both the pages it will clear the cache.And by clicking on the back button you will get fresh page from the server.
 
Share this answer
 
See my blog for more details :)

Web Development, Disabling the back button[^]
 
Share this answer
 
 
Share this answer
 
v2
hi all

use below code in the page source

<script>
windows.history.forward(1);
</script>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900