Note: If you installed pdf plugin to your browser, it will automatically displayed.
The above code will display save dialog to save pdf even if you have a browser with pdf plugin installed. So that the user can download directly instead of displaying it in browser and then saving..
rafemuhammed
Member
302 Points
99 Posts
Re: Open PDF file on button click or hyperlink from asp.net
Aug 07, 2010 01:04 PM|LINK
</div><div style="background: white none repeat scroll 0% 0%; font-size: 10pt; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; color: black; font-family: courier new;" mce_style="background: white none repeat scroll 0% 0%; font-size: 10pt; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; color: black; font-family: courier new;">Response.ContentType = "application/pdf";
Response.AppendHeader("Content-Disposition","attachment; filename=testpdf.pdf");
Response.TransmitFile( Server.MapPath("~/testpdf.pdf") );
Response.End();</div>
Note: If you installed pdf plugin to your browser, it will automatically displayed.
The above code will display save dialog to save pdf even if you have a browser with pdf plugin installed. So that the user can download directly instead of displaying it in browser and then saving..
Best of luck
rafemuhammed
MCA
rafes.net