Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Response.Redirect (Open new page and redirect current page)

Status
Not open for further replies.

notrut

Programmer
Feb 6, 2002
87
CA
Hi, Quick question:

How can you open up a new browser window to one url and, redirect the current page to a different url in one event?

I've tried using Javascript to open up the new window and using response.redirect to redirect the current page, but the first one fired always wins.

Response.Write ("<script>window.open('page2.aspx')</script>)
Response.Redirect("default.aspx")

Any help would be greatly appreciated.

Thanks.

 
I figured it out. Just use JavaScript to do both:

<script>
var originalWindow = window.self;
window.open('NewWindow.aspx');
originalWindow.location.href='Default.aspx';
</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top