| Author: HimaBindu Veeramachaneni 13 Oct 2005 | Member Level: Diamond | Rating:  Points: 2 |
To prevent this u can make the Page_Load event to occur whenever a back button is clicked so that u can make the necessary validations.
U can do this by simply implementing the following piece of code in page_load
Response.Cache.SetCacheability(HttpCacheability.NoCache)
This will make the cache empty and whenever the back button is pressed it fires the Page_Load event. Try this and let me know whether it works or not
http://dotnetspider.com/mentors/18-HimaBindu-Veeramachaneni.aspx?tab=details'
|
| Author: Ramakrishna 13 Oct 2005 | Member Level: Gold | Rating:  Points: 2 |
hi add the following code in each and every page load event
Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetAllowResponseInBrowserHistory(false);
or
add the following code in logout page
Response.Write("<script language=javascript>var wnd=window.open('','newWin','height=1,width=1,left=900,top=700,status=no,toolbar=no,menubar=no,scrollbars=no,maximize=false,resizable=1');</script>"); Response.Write("<script language=javascript>wnd.close();</script>"); Response.Write("<script language=javascript>window.open('Login.aspx','_parent',replace=true);</script>");
|
| Author: DotNET-Helper 13 Oct 2005 | Member Level: Gold | Rating:  Points: 2 |
Hi,
Use
Session.Abandon() Session.Clear() FormsAuthentication.SignOut() Response.Redirect("~/Default.aspx?signout=1")
in the signout button and login use FormsAuthentication.loginurl()
Happy Coding
|
| Author: vipul patni 29 Dec 2008 | Member Level: Bronze | Rating:  Points: 2 |
Well u can use this javascript to solve this problem! Use this javascript on Logout.asp or .aspx page.
<script language="JavaScript"> javascript:window.history.forward(1); </script>
Whenever user will click Back button , he will be forwarded to logout page again!!
|
| Author: rahulagrawal 31 Dec 2008 | Member Level: Silver | Rating:  Points: 1 |
just use window.history.forward(1); on the main page or page before logout page.
|
| Author: B. Gopal Surya Prakash 12 Jan 2009 | Member Level: Silver | Rating:  Points: 2 |
good solution is to place the following code in page_load event & hope this would work for u:
Response.Cache.SetCacheability(HttpCacheability.NoCache)
|
| Author: Robin Thomas 27 Jan 2009 | Member Level: Gold | Rating:  Points: 2 |
If you disable the cache for all the pages, it will affect the performance of the site considerably. So i always prefer to use javascript instead of setting the cache to NoCache.
Robin Thomas Freelancer visit for fresher jobs
|
| Author: B. Gopal Surya Prakash 28 Jan 2009 | Member Level: Silver | Rating:  Points: 0 |
Response.Cache.SetCacheability(HttpCacheability.NoCache)
|
| Author: A S H I S H 16 Feb 2009 | Member Level: Gold | Rating:  Points: 1 |
Hi ,
Hope it will help ...
Response.Cache.SetCacheability(HttpCacheability.NoCache)
good luck! Ashish
Warm Regards Ashish Tiwari 'Rome was not built in a day '
|
| Author: Nagamohan kumar P 20 Feb 2009 | Member Level: Gold | Rating:  Points: 2 |
This is the Java Script for that
in your html code Block
Script :--
<script language="JavaScript"> -- you can prevent going either ways by using the code line
window.history.forward(x); x is 1,2... </script>
|