Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Open a new window

Author  Topic 

reflex2dotnet
Yak Posting Veteran

99 Posts

Posted - 2007-03-22 : 11:05:43
Hi friends,

I have the below code, whcih redirects to a page.
How can i make this to open in a new window?
How to implement response.write with some javascript.
I tried one,, but it is having some syntax error.
Can anyone please help me?

Response.Redirect("test.aspx.aspx?var1=" & Session("var1") & "&var2=" & Session("var2") & "&var3=" & Session("var3") & "&var4=" & Session("var4"))

Can i get the session values there in the new window?

Thanks

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-03-22 : 11:13:09
Either

a) the link itself should be set to open in a new window

or

b) When the page posts back, instead of doing a response.Redirect, you need to register a Start-up client script on the page (or output a script as the text for a literal control along with opening/closing SCRIPT tags) that performs a window.open() action in javascript, opening the page you want to go to and passing in the params as necessary in the URL. this way, when the page posts back, when the browser renders it, it contains javascript that immediately opens up the page you want in a new window.

option b is done differently depending on what version of asp.net you are using, and of course you must know javascript and be familiar with it. A simple google gives tons of examples:

http://www.google.com/search?q=asp.net+register+client+script

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page

reflex2dotnet
Yak Posting Veteran

99 Posts

Posted - 2007-03-22 : 11:44:12
Thanks
I got it worked
Go to Top of Page
   

- Advertisement -