MaddY
MaddY

Reputation: 25

How to go back to previous page in asp.net while retaining the previous page data

I am having problem while using onclick="javascript:history.back();" with Aspnet. In the first page i filled some data and click search button it show some results, i click on particular result for its details which navigate to the 2nd page but when i click on custom back button it refresh the page and all data set to initial values,when i use onclick="javascript:history.back();" I get nothing but the page displays "webpage has expired."

Thanks in advance!

Upvotes: 0

Views: 2037

Answers (1)

user111013
user111013

Reputation:

This is because you are using HTTP POST for your search page. If you use HTTP GET (putting your parameters in the querystring) - then the browser won't display this message.

This has nothing specifically to do with ASP.NET. It's a (sensible) browser behaviour to prevent you from repeating an action that may have undesirable impacts (for instance, sending two copies of an order)

Upvotes: 3

Related Questions