Response.Redirect in a new window?

Many people have asked if they can use Response.Redirect to redirect in a new window, but unfortunately you can't do so because Response.Redirect method execute on the server-sideA0 and opening a new browser window is mainly a client side execution.

So you have to use Client-Side code to do this Like JavaScript window.open

 1: window.open('page.html', "_blank"); 

Follow this thread @ forums.asp.net

A0
A0

1 Comment

  • Hi,

    There is another approach. You can just set target attribute of a <form /> element to any non-empty value (actual value doesn't matter) and after the form is submitted and Response.Redirect is issued on the server-side the resulting page will be opened in a new window or tab.

    In this case client side code is not strictly necessary. You can conditionally set the target attribute prior the rendering of the form that should result in redirecting to a new window.

    Of course the attribute can also be set client-side before submitting the form.

    Best regards,

    Alexei Gorkov

Comments have been disabled for this content.