ankush ankush - 1 month ago 15
ASP.NET (C#) Question

if users press the browser's back button to reach the prior page..then page should display a message like "web page expired" in asp.net

if users press the browser's back button to reach the prior page..then page should display a message like "web page expired" in asp.net

can i use javascript for this???

for example..

there are 4 pages in web sites. 1,2 and 3 can be back. but when the 4th page run then 4th page can not be back... when the user press browser's back button , diaplay ma message "weg page expired".

Answer
<script type="text/javascript">
 function GoBack() 
   {
       window.history.go(+1);
   }
</script>

<body onload="GoBack();">

and Response.Cache.SetCacheability(HttpCacheability.NoCache);