tags:

views:

86

answers:

2

I have web application contain more than one page. I need to guarantee when I click Back in browser it execute the page-load event because in last page when I click bake it bring the previous page but it doesn’t execute page load and that cause problems. I appreciate any help

+1  A: 

When using the back button the browser displays a cached version of your page. It does not send a new request to your server. This is why your Page_Load is not firing.

You may want to take a look at HttpCachePolicy.SetCacheability that allows you to control caching.

Jakob Christensen
I add this Line Response.Cache.SetCacheability(HttpCacheability.NoCache);and tha back works correctly between pages but when I raise event in the same page and then click back it give me message " expired web page"
You will get the "expired web page" because the browser cannot do a HTTP POST when pressing back.
Jakob Christensen
A: 

I suspect you need to ensure the page is not cached in the brower.

An HTTP header such as

Cache-Control: private, max-age=0

should achieve that.

Although different web browsers may implement this differently, and it is possible a user's settings may override the HTTP header directives.

(This is speculation, I have not tested this)

Coding your app in such a way as to not rely on the page load event would be much better.

DanSingerman