There was an error in this gadget

Thursday, May 10, 2012

How to open PDF file in a new tab or window instead of downloading it using C#

If you want PDF to open in a new tab you would have to create an pdfdownload.aspx page and add the below code in page_load event.

Response.ContentType = "Application/pdf"; 
Response.TransmitFile(pathtofile);


OR

We can use single like statement as 

System.Diagnostics.Process.Start(pdfFileName);
 

No comments:

Post a Comment