Kyle Clarke [mailto:[EMAIL PROTECTED]] wrote:

> We're doing a Server.Transfer from one .aspx page to another
> .aspx web page. The second .aspx page response.clear()'s the
> buffer, response.writefile()'s a PDF/DOC/or XLS document from
> disk into the response buffer, sets the right http headers
> depending on the doc type, and then Response.End()'s to
> return the document in the browser to the end-user in a way
> that invokes the Acrobat, Word or Excel helper app within the
> browser window.
>
> The issue is that the browser history doesn't seem to be
> updated, so when the user presses the back button, they go
> back two actual pages rather than going back to the preceding
> page the document was launched from.

Hmmm... this makes sense to me as you're requesting one resource from the
browser (first.aspx) and unbeknownst to the client transfering to another
resource underneath (second.aspx). Since Server.Transfer is completely
server side, how is the client to know that another resource was used to
fulfill the request? If you need second.aspx to show up as a visited
resource in browser history, I think you're going to have to use
Response.Redirect. This would basically fulfill the request for first.aspx
and cause the client to make another explicit request for second.aspx.

> On the other hand, if we do a Server.Transfer to a .aspx page
> that renders itself as a normal .aspx page, the browser
> history is updated just fine and back goes back 1 page as it should.

But the history entry is for first.aspx right? I don't see how it could be
anything else, because, as I said, Server.Transfer is completely server side
and the client has no idea second.aspx is even being used. What Content-Type
are you specifying for the PDF/DOC/XLS responses? Does the browser have
handlers installed for these types or are they being offered for download.
The only explination I can think of for the difference in behavior is that
the transfer to an ASPX results in HTML which the browser can display and
thus it records in history, whereas if the browser doesn't have a handler
for the content type then all it can do is download it and I don't think it
will record a history entry for types it can't display.

HTH,
Drew
.NET MVP

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to