Solved

Browser back button - Disable

Posted on 2008-06-18
4
257 Views
Last Modified: 2013-11-26
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.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetExpires(DateTime.Now)

2. Second Process :
In the Page_load event I wrote the following :
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetExpires(DateTime.Now)

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 ?????
0
Comment
Question by:akulavi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 21

Expert Comment

by:naspinski
ID: 21811125
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.
0
 
LVL 28

Expert Comment

by:iboutchkine
ID: 21811762
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.SetCacheability(HttpCacheability.NoCache)
0
 

Author Comment

by:akulavi
ID: 21811821
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 ?
0
 
LVL 28

Accepted Solution

by:
iboutchkine earned 500 total points
ID: 21811986
It is not possible
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question