473,325 Members | 2,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

IE& back forward button

dotneto
36
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 1418
Plater
7,872 Expert 4TB
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
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
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
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
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 (&...
2
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...
2
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...
1
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...
2
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...
6
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...
3
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...
4
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.