Open pdf in new browser

Open pdf in new browser

Forum member · Nov 27, 2006
I am trying to use the DrawToWeb method to open a pdf in a new browser. I have seen the postings that say to use target="_blank" in the <Form tag. The web application I have is using a Site.Master page with contains the <Form tag and the individual pages to not contain a <Form tag. If I add target="_blank" to the Site.Master page, a new browser is opened up everytime a Response.Redirect is called. Is there any other way to open the pdf in a new browser? Thanks

Re: Open pdf in new browser

Support · Nov 28, 2006
Hello, You can open a new page which creates a PDF document by calling javascript in a button click event. This could be a probable solution to open the PDF in a new window. Following is the sample javascript code to use in the button click event. string popupScript = "<Script Language='JavaScript'> PDF_window=window.open('HelloWorld.aspx','PDF_window', 'resizable=yes');PDF_window.focus() </Script>"; RegisterStartupScript("PopupScript", popupScript); Thanks, ceTe Software Support Team.

Re: Open pdf in new browser

Forum member · Nov 28, 2006
I was already on to that and it works. I added '_blank' in the window.open arguements as well. string scriptblock = "<script language='javascript'>window.open('mydocument.pdf', '_blank');</script>"; Thanks for your reply.