473,802 Members | 1,984 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I clear the history of a browser page by using scripts or programming

16 New Member
How can I clear the history of a browser page by using scripts or programming
Feb 27 '08 #1
3 2678
Plater
7,872 Recognized Expert Expert
You can't. (As far as I am aware)
What you *CAN* do, is dictate that your pages are never cached in the first place though. Response.CacheC ontrol or something like that should contain information on to do that.
Feb 27 '08 #2
gagandeepgupta16
56 New Member
hi

try this,

//clears browser history and redirects url
Expand|Select|Wrap|Line Numbers
  1. <SCRIPT LANGUAGE=javascript> 
  2. {
  3.  
  4.   var Backlen=history.length;   history.go(-Backlen); 
  5.   window.location.href=page url
  6.  
  7.  }
  8.  
  9. </SCRIPT>
  10.  

I found this at the below link
http://forums.asp.net/t/1132444.aspx

it worked for me...
Mar 18 '08 #3
Frinavale
9,735 Recognized Expert Moderator Expert
This sounds like a terrible idea.

You're clearing a persons browser history...that means that all of their browsing history will be destroyed when they visit your site...they may actually depend on it to find some websites they forget the links to.

I would do as Plater says, state that your page is not to be cached by setting meta tags:

Expand|Select|Wrap|Line Numbers
  1. <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
  2. <META HTTP-EQUIV="EXPIRES" CONTENT="0">
  3. <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
  4.  
Do this using the Response.CacheC ontrol that Plater was talking about.


-Frinny
Mar 18 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

15
7309
by: Peter Bremer | last post by:
Hi all, I've written this little piece of code, which doesn't seem to work in Mozilla 1.5. I haven't tried it on other Gecko browsers, but I've found some indication that Netscape 6+ has the same problem. Internet Explorer 6 and Opera 7 have no problems with it. <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'> <script>document.write (window.history.length);</script>
3
10039
by: Rob | last post by:
Each time a webform is posted back (submitted), another URL is added to the browser's history list. My web application allows a back button to return to previously visited pages, but I do not wish to return to each Postback URL, but rather only the initial page URL. Is there a way to prevent Postback URL's from being added to the browser's history list Thanks in advance for any help.
1
4228
by: David | last post by:
A user logs into a web site. He is then redirected to a web page of his choosing - based on menu options - for example: "WeeklyReport.aspx" is a page the user is currently viewing If the user session times out, I redirect the user to a "logoff.aspx" web page that now informs the user he must relogin to the web site Question: Is there anyway to clear the browser's history list (prior to Response.Redirect("logoff.aspx") - to ensure the user...
4
3133
by: Tim Marsden | last post by:
Hi, If I navigate from Page1 to Page2 then to Page3, using the response.redirect. When the user press the Back button, I what then to go to Page 1 and start again, not Page2. I dont want the to navigate to Page2 using the Back and Forward buttons. How do I do this.
2
1901
by: | last post by:
I am working on an ASP.NET application that seems to be limiting browser histories to only one entry. I am not using SmartNavigation on any of the pages, and that is the only thing that I have seen in the documentation that says it limits the browser history. The pages in the application are in a single IIS folder, which is set up as an application and is NT password protected and SSL encrypted, and has the HTTP headers set to expire the...
8
2671
by: Ed Jay | last post by:
I want to use history.go() to navigate between my previously loaded pages. I'm looking for a way to trigger a function call when a page is accessed using history.go(). Is there an event generated? Is there a method for detecting what page the user came from when a page is accessed using history.go()? -- Ed Jay (remove M to respond by email)
10
10503
Ajm113
by: Ajm113 | last post by:
Making a History Page for BIG Sites Intro: Ok, let's say after a while your website has grown massive. We're talking search engine, forum and video hosting -- you've got a LOT of content. And you are wondering, "Why do I need yet another feature for my big site?" Well, some people can become forgetful every time they see content on your site, and let's suppose that one day they needed to work on a good php script for their class and they...
2
2367
by: Vighneswar | last post by:
Hi All Please let me know is there any way to clear the address bar history ( Typed URLs) of Firefox browser programmatically. Deleting 'index.dat' under profiles folder of firefox will delete both ( history and Typed URLs ). Here I need to clear only the address bar history of firefox. Also is there any way to programmatically delete IE7 browser history on Windows Vista. I could able to delete IE7 browser history on Xp machine, but...
2
3447
by: Max | last post by:
I recently moved to ASPnet Ext 3.5 What I can't get with Ajax and History browser managemet is this: User fills some fields (dropdown and textbox) on page 1 (all are in an update panel) User clicks Submit Button I write the data into a DB I add a history point with ScriptManager to be able to get back to this point with browser back button Page 2 is loaded with a response.redirect() command
0
9699
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9562
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10285
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10063
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9115
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2966
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.