Click here to Skip to main content
15,904,934 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#

hi, I have an issue that relates to the 'Back' button in the browser.

1. When I click 'Back' in the browser, I expect to reach the previous page ( the previous page should be loaded) but it doesn't get loaded. When I debug it, I don't see the page reload itself. (could it be a cache issue?)
Posted
Comments
Sandeep Mewara 8-May-12 11:03am    
Have you written any code related to page history or cache or so?

I think the best answer is: It depends on the browser, especially after a post/postback.

Older browsers used to pop up a confirmation dialog to the effect of "the page contains POST data which will be resubmitted", and you could either proceed (resubmit) or cancel out. Since everything that happens in ASP.NET WebForms is part of the FORM element (ViewState, events, etc.), this would cause the entire lifecycle to be repeated.

Of course, this caused no end of trouble with duplicate submissions, so many sites had to come up with workarounds for the dupe problem, and today most browsers just fetch the page from cache instead.
 
Share this answer
 
Thank you for the explanation but how do I make the browser post the page again when the user clicks 'Back'?
I read that I should set the Cache-Control header to no-cache.
Will this thing work?
 
Share this answer
 

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