load a word document inside window browser

Posted by netNewbi3 on Stack Overflow See other posts from Stack Overflow or by netNewbi3
Published on 2010-06-18T14:17:54Z Indexed on 2010/06/18 14:33 UTC
Read the original article Hit count: 205

Filed under:
|
|

Hi, I have a page that dynamically links to a document that opens in a new page (the document is stored in a database as binary data and I loaded using the following code:

Response.ClearContent()

Response.ContentType = myReader("MIMEType").ToString()

Response.AddHeader("Content-Disposition", "inline; filename=" & myReader("Filename"))

Response.BinaryWrite(myReader("DocBD"))

Response.End()

This works ok. However some documents have restricted access and before loading the document the user is redirected to a login page. After entering username and passowrd the document is loaded. If it is a pdf file for example, it loads in the same login page, but when it is a word or excel document it opens outside the browser window and the login page remains in the background. Is ther a way to force a word or excel document to open inside the browser window? Many thanks.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about download