Word document open issue
In my application users upload their resumes in Word format. I would like to be able to display these Word documents in a .aspx web page that includes a button to return to the previous page instead of getting the message 'Do you want to open or save this file" and displaying it in a separate Word window.

Dipal ChoksiPosted Sep 26, 2010, 5:12 PM
You'll need to write code as follows (replace yourfile.doc with variable containing your word file name)
...
Response.Clear()
Response.ContentType = "application/octet-stream; name=yourfile.doc"
Response.AddHeader("content-transfer-encoding", "binary")
Response.AddHeader("content-disposition", "attachment;filename=yourfile.doc")
Response.ContentEncoding = System.Text.Encoding.GetEncoding(1251)
Response.BinaryWrite(f):
...
You might want to use iFrames as another option.
There are some other possible solutions too. Hope this helps!