Quantcast
Channel: Internet Explorer Web Development forum
Viewing all articles
Browse latest Browse all 3527

Suppress File Dialog with Response.WriteFile

$
0
0

I'm using asp.net and everytime I try to display a .docx file I get a windows prompt asking "Do you want to open or save this file?" instead of it just opening in the browser window. I do not get the dialog with .pdf files. My code is:

Response.ContentType = "application/msword";

 Response.Clear();

 Response.Charset = "";

filepath = filepath + filename;

  Response.WriteFile(Context.Server.MapPath(filepath));

   Response.End();

           

 


          


jperry


Viewing all articles
Browse latest Browse all 3527

Trending Articles