How to launch another aspx web page upon button click?

I have an application, where the user would click a button and launch another page (within the same application). The issue I am facing is that the original page and the newly launched page should both be launched.

I tried response.redirect, but that tends to unload the original page.

Any suggestions?


Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

This button post to the current page while at the same time opens OtherPage.aspx in a new browser window. I think this is what you mean with ...the original page and the newly launched page should both be launched.

<asp:Button ID="myBtn" runat="server" Text="Click me" 
     onclick="myBtn_Click" OnClientClick="'OtherPage.aspx', 'OtherPage');" />

Method 2

Edited and fixed (thanks to Shredder)

If you mean you want to open a new tab, try the below:

protected void Page_Load(object sender, EventArgs e)
    this.Form.Target = "_blank";

protected void Button1_Click(object sender, EventArgs e)


This will keep the original page to stay open and cause the redirects on the current page to affect the new tab only.


Method 3

If you’d like to use Code Behind, may I suggest the following solution for an asp:button –


<asp:Button ID="btnRecover" runat="server" Text="Recover" OnClick="btnRecover_Click" />

Code Behind
    protected void btnRecover_Click(object sender, EventArgs e)
        var recoveryId = Guid.Parse(lbRecovery.SelectedValue);
        var url = string.Format("{0}?RecoveryId={1}", @"../Recovery.aspx", vehicleId);

        // Response.Redirect(url); // Old way

        Response.Write("<script> '" + url + "','_blank' ); </script>");

Method 4

Use an html button and javascript? in javascript, window.location is used to change the url location of the current window, while will open a new one

<input type="button" onclick="'newPage.aspx', 'newPage');" />

Edit: Ah, just found this: If the ID of your form tag is form1, set this attribute in your asp button
OnClientClick=" ='_blank';"

Method 5

You should use:

protected void btn1_Click(object sender, EventArgs e)

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x