Thursday, May 5, 2011

Open Response.Redirect url in a new window

ASP Button code:

Add OnClientClick="return NewWindow();"


function NewWindow()

    document.forms[0].target = "_blank";


Change target attribute of Form tag to blank using javascript.

C# Code:

Now add Response.Redirect to Button Click event handler.

This will open the new url in the new window

No comments:

Post a Comment