Asp Net Source.com
What's ASP.NET?

AspNetSource.com's BLOG

AJAX, ASP.NET, C#, CSS, Design, .NET Framework, Javascript, SQL, VB.NET, etc.

How to Open a Redirect in a New Window

Posted by Tihomir Ivanov on 16 January 2010 19:17
Rating: 7.00

You may often use the Response's Redirect method to open new pages, ex:

Response.Redirect("http://www.devtheweb.net");

It will open the url in the same window.

If you want to open url by server side in a new window, it cannot be done using the Response's Redirect method.
But it can be done using JavaScript, here is an example:

ClientScript.RegisterStartupScript(typeof(Page), "key", "<script>window.open('http://www.devtheweb.net','_blank')</script>");

 Comments:
ph Posted by SQL course on 12 January 2011 21:23   Rating: 7
Thank you for posting this. This can help me. I'm studying javascript now.
 
Our Sponsors:  Asp.net file upload component  |   Flash file uploader  |  ASP.NET Hosting