This does not change my current page or open a new window. It is like I am missing another command to activate the new script in a new window.
I also tried viewState, but it is limited to the current page and is not available on the next page so I passed the parm in the URL.
I did create a new page and used Response.Redirect("displayPDF.aspx?FileName=" & fullUploadPath) to open my new page,
Then in my new page I coded
Blazingfun
Member
6 Points
4 Posts
Re: How to display a pdf document inside a web form?
Jan 16, 2007 03:26 AM|LINK
Thanks for the response.[:)]
I should have mentioned that I am using VB and .NET ver 2.0.
When I use Page.RegisterStartupScript I get a message telling me that page.registerStartupScript is obsolete. So I tried
ClientScript.RegisterStartupScript(
GetType(String), "Test", "window.open('displayPDF.aspx?FileName=" & fullUploadPath & "')")This does not change my current page or open a new window. It is like I am missing another command to activate the new script in a new window.
I also tried viewState, but it is limited to the current page and is not available on the next page so I passed the parm in the URL.
I did create a new page and used Response.Redirect("displayPDF.aspx?FileName=" & fullUploadPath) to open my new page,
Then in my new page I coded
fullUploadPath = Request.Params(
"FileName")Response.ContentType = "application/pdf"
Response.AddHeader("Content-Type", "application/pdf")
Response.WriteFile(fullUploadPath)
Response.End()
This doesn't open a new page, it uses my current page to show the PDF file and then I can use the back button to return to my selection page.
Thanks for your help!