I think in many time developer need this event, which is not provided by any browser and it is not captured by any javascript event.In this Article you see how you capture this event and how you force the browser to load the page from server.

Introduction:

I think in many time developer need this event, which is not provided by
any browser and it is not captured by any javascript event.In this Article you
see how you capture this event and how you force the browser to load the
page from server.
 
Description:

For this to work you can use this code in every Page Load,

 
This code is used first create a cookie for a small duration, i.e for 15 seconds
Here 15 is used to show that the Cookie is expires after 15 seconds, you can set
it himself depending on duration.It is time between Page Load execute
and when User Click Back Button to come again in this page. You set it any time
but ensure that it is not more then the time from Page Load execute to user
go to another Page and then come back to this page By Clicking Back Button.

Two Problem may create when you set less time(here set 15), before Browser
reading the Page then the cookie expires due to which it won't works.
 
Another Problem may occur if we set more time(here set 15), when user click's
Back's Button then cookie not expire due to which it again won't.
 
There fore you need to carefully set this intervel such that cookie not expires
when Page Loads from server but must expire if user go to another then come back  by Back button.
 
Also there are two Javascript functions,getCookieValue is used to get the cookie value,
window.onload is called when browser loads the Page.In this event it simply
checks that whether cookie exists or not, if exsist then the page is coming from
server, if not exsist then page is not coming from server because the cookie life
is set only when server's Page Load event called which set cookie for a small life
time. The Life Time contains the time in which Browser can only reads the cookie
only once per post back.

Also you can load the page from server when browser select
page from Browser Cache by location.reload(true);
 
Here is complete code in the Page Load Method:


It only needs the given script,


Author:

Imran Baloch have completed my MCS from Ku Last Year by taking Gold Medal.