473,796 Members | 2,702 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IE& back forward button

dotneto
36 New Member
Hi,
There is a strange behaviour with ie7 and browsing history. In a page (aspx), the user can download a file. If he navigates back from that page, the page is lost(from browsing history), an sometimes it navigates to another page, the previous, is there is one.
I mean,you were in page 2 an navigate to page 3, download the file and everything and click the back button, you were supposed to be taken to page 2 again, but no, the page 2 was deleted from the browsing history. I looked in browsing history, and is not there.
Of course, this doesn't happen in Firefox, just IE 7. I have seen this behavior in other applications but for this client, he really wants it to work properly. :(
Any Idea?
Thanks
Jul 19 '07 #1
3 1433
Plater
7,872 Recognized Expert Expert
What do you have the caching settings set to in the headers?
I was fighting a problem for a LONG time, even went to great lengths to produce a work around...only to discover the issue was with Caching.

I had the header set to pretty much "never ever cache this page anywhere" and IE would listen and not cache it (causing an issue) but firefox would keep it around without causing the problem. This led me to believe IE was stupid (I didn't know about the chacing thing) and I spent a week developing a workaround.

So moral of the story is, check your chaching, it's possible IE7 removes it from its history on a no cache statement (The RFC says that's allowable)
Jul 20 '07 #2
dotneto
36 New Member
What do you have the caching settings set to in the headers?
I was fighting a problem for a LONG time, even went to great lengths to produce a work around...only to discover the issue was with Caching.

I had the header set to pretty much "never ever cache this page anywhere" and IE would listen and not cache it (causing an issue) but firefox would keep it around without causing the problem. This led me to believe IE was stupid (I didn't know about the chacing thing) and I spent a week developing a workaround.

So moral of the story is, check your chaching, it's possible IE7 removes it from its history on a no cache statement (The RFC says that's allowable)

Hi, maybe if you could se the code, this is an example:

Expand|Select|Wrap|Line Numbers
  1.             FileStream fs;
  2.             string strPath = Server.MapPath("~/pdf/");
  3.             string strFileName = "vista_upgrade_flowchart.pdf";
  4.             fs = File.Open(strPath + strFileName, FileMode.Open);
  5.  
  6.             byte[] bytBytes = new byte[fs.Length];
  7.             fs.Read(bytBytes, 0, (int)fs.Length);
  8.             fs.Close();
  9.             Response.AppendHeader("Content-disposition", "attachment; filename=" + strFileName);
  10.             Response.ContentType = "application/octet-stream";
  11.             Response.End();
this is a simple code example, easy to reproduce.

Tree pages,page one with a link to page to, page 2, with a button to download a file and a link to page tree. Without downloading the file, everything works fine. If you navigate from page 1 to page 2, hit the button, download the file, and hit the link to go to page 3, you go to page tree. Now, if you hit the back button, you are taken to page 1, skiping page two.
I think it has something to do with the header that we append to the response(when we download the file), messes up with the history or something. Not sure. I tried changing cache settings. I don't know how to set this settings properly.
I'm desperate and confused.
Help please.
Thanks.
Jul 20 '07 #3
dotneto
36 New Member
Hi, maybe if you could se the code, this is an example:

Expand|Select|Wrap|Line Numbers
  1.             FileStream fs;
  2.             string strPath = Server.MapPath("~/pdf/");
  3.             string strFileName = "vista_upgrade_flowchart.pdf";
  4.             fs = File.Open(strPath + strFileName, FileMode.Open);
  5.  
  6.             byte[] bytBytes = new byte[fs.Length];
  7.             fs.Read(bytBytes, 0, (int)fs.Length);
  8.             fs.Close();
  9.             Response.AppendHeader("Content-disposition", "attachment; filename=" + strFileName);
  10.             Response.ContentType = "application/octet-stream";
  11.             Response.End();
this is a simple code example, easy to reproduce.

Tree pages,page one with a link to page to, page 2, with a button to download a file and a link to page tree. Without downloading the file, everything works fine. If you navigate from page 1 to page 2, hit the button, download the file, and hit the link to go to page 3, you go to page tree. Now, if you hit the back button, you are taken to page 1, skiping page two.
I think it has something to do with the header that we append to the response(when we download the file), messes up with the history or something. Not sure. I tried changing cache settings. I don't know how to set this settings properly.
I'm desperate and confused.
Help please.
Thanks.

Please If anyone has an idea, I'll realy like to know why this happens.
Aug 24 '07 #4

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

Similar topics

15
2333
by: F. Da Costa | last post by:
Hi all, Following two sniperts of code I'm using and getting very interesting results from. ..html <tr id="1" class="segment" open="false"> This is the segment under 'investigation' ..js
2
2969
by: Ian Beer | last post by:
I am told by a couple of Mac users that a site I am building does not display properly under either IE or Safari, they no not seem to agree however exactly what the display problems are. CSS (& XHTML) are both standard compliant and the site displays as intended under Firefox and IE 5+ onward on a PC. Could anyone with a Mac take a look at http:/www.woodchester.ruthani.co.uk and tell me what the display problems are and whether they...
2
1498
by: themhz | last post by:
I created a form with a list box item .when a user logs on in that page and clicks three times on diferent items in the list box , if he clicks the back button on the IE the browser will bring him one step before . i need to know how can i catch that back event of the IE so i can move the user to the page he was before .
2
1286
by: Calvin KD | last post by:
Can anyone out there show me how to disable the IE back button please. I have Session variables holding user's credentials and my .Net application seems to get confused after the user clicks the Back button. Is there a way around it? Any suggestion is greatly appreciated. KD
1
1076
by: Developer | last post by:
We have an InterNet Application that does not use cookies, session variables, persistant cookies etc. But we collect the information on multiple forms (about 6 steps). Also we cannot count the entry as a submittal until the 4th page is submitted. So we need to carry the values from 1 thru 4 pages. And also based on the information the user provides on page 1 we have to display different pages. This happens all the way from page 1 thru 4. ...
2
1252
by: Niels Peter Heick | last post by:
Is there a way to capture the Back Button when it is clicked via the IE. I am developing a ASP.NET page and I need to know when users click on the Back button. After the event from the back button, I need to control server side variabels. How can I do that ?
6
2804
by: Raghu Raman | last post by:
Hi, we are doing an in house project in c#.net(asp.net).We wanted to close our application when ever the user presses the SIGNOUT button. Even though we programtically disconnects them from the database,when we press the Internet explorers Back button ,all the browsed pages are displayed with the data**. 1.could you pls tell me how to disable the back-button of IE
3
1401
by: Uhway | last post by:
1. How can do disable IE back button when I am on certain pages? 2. When user clicks ob IE back button, how can I force them to return to the same page? The reason I want to do is, after they click on the finish button after navigating through four or five pages, I don't want an user to revisit the data entry pages. At the same time can I reset those pages on clicking finish button. But at the same time before clicking on the finish...
4
1450
by: Alan Wang | last post by:
Hi there, I am having a problem with my asp.net web pages. If user hit BACK button on IE and then click some other web controls on the web page. the page goes to blank page. Anyone has the solution for this? Alan
0
9673
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
10217
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10003
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
9047
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
5440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5568
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4114
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
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
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.