Using ASP.NET 2
I have an aspx page where a linkbutton posts back, generates a pdf file, and uses the following method to send the file back to the client
Dim r As System.Web.HttpResponse = System.Web.HttpContext.Current.Response
r.Clear()
r.ClearContent()
r.ClearHeaders()
r.AppendHeader("content-disposition", "attachment; filename=" & userFileName)
r.ContentType = "application/pdf"
r.TransmitFile(filePath)
r.Flush()
r.End()
This causes an Open/Save dialog box to pop open, which is exactly what I want.
However, after saving the file, ALL the links in the page still in the browser are broken. For example, a link that WAS
http://www.myserver.com/myapp/admin/commissionmgmt.aspx
becomes
http://www.myserver.com/myapp/admin/undefined
It is even changing the directory structure of the link. A link that was:
http://www.myserver.com/myapp/home.aspx
becomes
http://www.myserver.com/myapp/admin/undefined
This is the case for EVERY link on the page
This happens (on windows xp) in Safari, Chrome and Firefox (all most recent versions) but NOT in IE. Most of my users use IE but I'd like this to work everywhere.