akulavi
asked on
Browser back button - Disable
In my website whenever user clicks on back button of browser it works. I want to stop this functionality. For that have already used two three processes. but no one is working !!!!!!!
1. First Process :
In the Page_Init event I wrote the following:
Response.Cache.SetCacheabi lity(HttpC acheabilit y.NoCache)
Response.Cache.SetExpires( DateTime.N ow)
2. Second Process :
In the Page_load event I wrote the following :
Response.Cache.SetCacheabi lity(HttpC acheabilit y.NoCache)
Response.Cache.SetExpires( DateTime.N ow)
3. Third Process :
In the page_Load event I wrote the following:
Response.Buffer = true;
Response.Expires = 0;
Response.ExpiresAbsolute = DateTime.Now.AddDays( -1 );
Response.CacheControl = "no-cache";
4. I have tried with Javascriot also. it is working fine. But if some user's Browser is Javascriot disabled then following code cannot work.
<script type="text/javascript" language="javascript">
javascript:window.history. forward(1) ;
</script>
What should I do ?????
1. First Process :
In the Page_Init event I wrote the following:
Response.Cache.SetCacheabi
Response.Cache.SetExpires(
2. Second Process :
In the Page_load event I wrote the following :
Response.Cache.SetCacheabi
Response.Cache.SetExpires(
3. Third Process :
In the page_Load event I wrote the following:
Response.Buffer = true;
Response.Expires = 0;
Response.ExpiresAbsolute = DateTime.Now.AddDays( -1 );
Response.CacheControl = "no-cache";
4. I have tried with Javascriot also. it is working fine. But if some user's Browser is Javascriot disabled then following code cannot work.
<script type="text/javascript" language="javascript">
javascript:window.history.
</script>
What should I do ?????
This is by design. Javascript is the only client-side 'handle' you can get on your user's browser. If that is turned off it is because the user doesn't want to have any chance of their personal software manipulated unknowingly by your software. There is no legal way to enforce this.
It is not possible to disable Back button but
If you open a page in a new window that window will have no history and therefore no back button
also try this
Add the following to the Page_Load event of your page:
Response.Cache.SetCacheabi lity(HttpC acheabilit y.NoCache)
If you open a page in a new window that window will have no history and therefore no back button
also try this
Add the following to the Page_Load event of your page:
Response.Cache.SetCacheabi
ASKER
My question is not about disabling Back button or like that. What I want is that whenever user clicks on the Back button then user must not move in the previous page ..........Rather than it should move to a specified page .
How to achieve this ?
How to achieve this ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.