Change the form in your first page into this:
<form id="form1" runat="server" method="get">
<asp:HiddenField runat="server" value="true" id="newtab" />
<asp:Button id="Button1" runat="server" height="32px"
Width="75px" Text="Submit" />
</form>
Add this in the
Page_Load
function of your C#:
protected void Page_Load(object sender, EventArgs e)
{
try
{
if (Request.QueryString["newtab"].ToLower() == "true")
{
Response.Redirect("NewPage.aspx");
}
}
catch { }
form1.Target = "_blank";
}
What the code does:
When you press the Submit button,
you'll be redirected to the same page, but the value
"newtab"
in
Request.QueryString
is set to
"true"
.
Response.Redirect
redirects you to a new page,
and
form1.Target = '_blank'
opens the new pab page.
Hope this helps.