title: How to remove target='_blank' after postback event?
body: <p>I have added a button on my asp page and I am executing some process at server side then redirecting a link to another page. </p>
  
  <p>What I am doing in my page is that I am calling a method On <code>asp:Button</code> <code>OnClientClick</code> event where I am assigning a <code>aspnetForm.target='_blank'</code> to navigate the page in different tab. </p>
  
  <p><strong>ASP.NET CODE:</strong></p>
  
  <pre><code>&lt;asp:Button ID='btn' runtat='server' OnClientClick='ShowPage();' Text='Show Page' /&gt;
  </code></pre>
  
  <p><strong>JavaScript CODE:</strong></p>
  
  <pre><code>function ShowPage() {
      aspnetForm.target = '_blank';
  }
  </code></pre>
  
  <p>I am using using <code>Response.Redirect()</code> method to navigate a page. This method is called only after verifying required validations at server side. </p>
  
  <p><strong>C#.NET Code</strong></p>
  
  <pre><code>If (ValidData())
  {
     Response.Redirect('myPage.aspx?preview=true', True);
  }
  </code></pre>
  
  <p>The validation code is huge and there are also some further process are being executed during the validation. So, I cannot use <code>WebMethod</code> for <code>ajax</code> call.</p>
  
  <p>Everything is working correctly but, the problem is that there are some other links and buttons also. So, when i click on any of them the page is also redirecting for that particular request and I don't want to do that. It happens because the `aspnetForm.target='_blank`` is still exist in the asp form and it will perform same action for other links also.</p>
  
  <p>My requirement is that the page should be navigated in new tab only when a particular button is pressed. other navigation process should be done is same page. I am wondering that is there any method that i can use to remove <code>target = '_blank'</code> after postback. </p>
  
  <p>I cannot use <code>rel='external'</code> because I am not using <code>anchor&lt;a&gt;</code> tag. I am using <code>asp:Button</code> which is also handling some server side events. </p>
  
  <p>Or is there any other way that i can use to navigate the page in new tab without using <code>target='_blank'</code> method?</p>
  
  <p><strong>EDITED:</strong></p>
  
  <p>Currently I am using <code>Page.ClientScript.RegisterStartupScript()</code> to execute my <code>Popup</code> window script. But, when the popup blocker is on it doesn't work. So, I have to chose another way.</p>
  
  <pre><code>Page.ClientScript.RegisterStartupScript(Me.GetType(), "OpenWindow", "window.open('myPage.aspx?preview=true','_newtab');", True)
  </code></pre>