How to launch another aspx web page upon button click?

Csharp picture Csharp · Sep 9, 2011 · Viewed 206.2k times · Source

I have an asp.net 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?

Answer

Claudio Redi picture Claudio Redi · Sep 9, 2011

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="window.open('OtherPage.aspx', 'OtherPage');" />