i have retrived the pdf file from Database and i linked it to a tag to open pdf file using link. now i want to give the open/save dialog box before a pdf file opened . - in javascript(by using onclick event in tag to call the javascript)
+2
A:
You have to set the content-disposition header using C# to get this behavior in a browser.
Read this for more info
How do I prompt a "Save As" dialog for an accepted mime type?
Downloading a File with a Save As Dialog in ASP.NET
Example
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName);
Response.AddHeader("Content-Length", targetFile.Length.ToString);
Response.ContentType = "application/pdf";
Response.WriteFile(targetFile.FullName);
rahul
2009-11-28 05:39:38
+1, here's another related SO post: http://stackoverflow.com/questions/1024910/allowing-user-to-download-from-my-site-through-response-writefile
o.k.w
2009-11-28 05:44:30