I have below code. How do I open the pdf file in new window?
Please help. TQ in advance.
// utk file di server
string filePath = Server.MapPath("~/isoChecklist/" + (sender as ImageButton).CommandArgument);
Response.TransmitFile(Server.MapPath(filePath));
FileInfo file = new FileInfo(filePath);
// Checking if file exists
if (file.Exists)
{
// Clear the content of the response
Response.ClearContent();
// LINE1: Add the file name and attachment, which will force the open/cance/save dialog to show, to the header
Response.AddHeader("Content-Disposition", "inline; filename=" + file.Name);
// Add the file size into the response header
Response.AddHeader("Content-Length", file.Length.ToString());
// Set the ContentType
Response.ContentType = ReturnExtension(file.Extension.ToLower());
Response.TransmitFile(file.FullName);
Response.End();
}