Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 11, 2013 07:29 PM by Mhorkpheus
Aug 07, 2007 05:25 PM|LINK
Hope someone can help me with this problem. I'm using VS.2005 ASP.NET/VB.NET along with the latest release of AJAX for ASP.NET.
Goal: When the user clicks on an ASP.NET button in an AJAX update panel I do a number of things in the code behind that update the page via AJAX. This portion is working fine but now I have a new requirement.
When the user clicks on the same button I also need to open up a new browser window that points to a dynamically generated (meaning the URL is different each time) PDF.
For example I would need to open something like 'http://www.test.com/mypage.aspx?ApplicantID=356235&Type=JobApplication
I also tried the following code which works w/o and AJAX Update panel but stops working when I add an AJAX update panel
Dim strURL As String = "http://mysite.com?Test=3243243"
Dim jScript As String
jScript = "<script>window.open ('" & strURL & "','_blank');</script>"
Is there any other way to do this?
Thanks in advance for any help.
Aug 07, 2007 06:28 PM|LINK
the reason it doesn;t work is because on a partial postback the client script does not get written to the page and fired. What you could try and do, and this will only work if the page which needs to be opened does not depend on values set durring the partial
This video can help to do this.
Aug 07, 2007 08:45 PM|LINK
Aug 08, 2007 07:01 PM|LINK
Here's the code that works (provided from http://vbcity.com).
Thanks everyone for the help
Feb 11, 2013 07:29 PM|LINK
Exelent! it works!!
Thanks a lot!!!!!!