G
Guest
We have a situation where we display PDF files through IE via a method in our code-behind as follows
protected void displayPDF(string exePath, string filePath
{
// exePath is the Request.CurrentExecutionPath and we trim off the actual ASPX page designation an
// replace that with the "filePath" which represents the path and PDF that we want to display
string fullPath = exePath.Substring(0, exePath.LastIndexOf('/'))
fullPath += filePath
// Next, we create a physical path from the virtual pat
fullPath = Server.MapPath(fullPath)
// Create a FileInfo object and write it to the response
FileInfo theFile = new FileInfo(fullPath)
Response.Clear()
Response.ContentType = "application/pdf"
Response.Flush()
Response.WriteFile(theFile.FullName)
Response.End()
This code works and displays the PDF through IE in the browser. It also keeps our PDF secure because bookmarking the page simply bookmarks the ASPX that generates this file and that is protected by our custom security scheme. (Thanks to members of the newsgroup for pointing me in the right direction about this - an earlier post.
Now, we have an additional requirement to do this display, but to do it in a new and separate browser window from the one that originates the request. So, the original browser window, with link buttons that call the method above remains behind the new browser window with the displayed PDF
Is it possible? And if so, how
Thanks.
protected void displayPDF(string exePath, string filePath
{
// exePath is the Request.CurrentExecutionPath and we trim off the actual ASPX page designation an
// replace that with the "filePath" which represents the path and PDF that we want to display
string fullPath = exePath.Substring(0, exePath.LastIndexOf('/'))
fullPath += filePath
// Next, we create a physical path from the virtual pat
fullPath = Server.MapPath(fullPath)
// Create a FileInfo object and write it to the response
FileInfo theFile = new FileInfo(fullPath)
Response.Clear()
Response.ContentType = "application/pdf"
Response.Flush()
Response.WriteFile(theFile.FullName)
Response.End()
This code works and displays the PDF through IE in the browser. It also keeps our PDF secure because bookmarking the page simply bookmarks the ASPX that generates this file and that is protected by our custom security scheme. (Thanks to members of the newsgroup for pointing me in the right direction about this - an earlier post.
Now, we have an additional requirement to do this display, but to do it in a new and separate browser window from the one that originates the request. So, the original browser window, with link buttons that call the method above remains behind the new browser window with the displayed PDF
Is it possible? And if so, how
Thanks.