How to Open a PDF file in a web application
I was surfing the web, and I found a site that opens a PDF file in a new page, so I thought I'll share the method of how to that with everyone :)
In the main page add this line:
Where frmReport.aspx is the name of the form in which you will open the file and frmReport.aspx is the name of the file, which of course you can read dynamically.
Now in the frmReport.aspx ad the following code in the Page_Load.
protected void Page_Load(object sender, EventArgs e)
string strFileName = Request.QueryString["r"];
Response.ContentType = "application/PDF";
Notice that the name of the file is sent through the URL.
Hope this will help someone in need :p
Nothing is impossible. The impossible only takes longer. "Digital Fortress, Dan Brown"
Nothing is impossible. The impossible only takes longer. \"Digital Fortress, Dan Brown\"