title: How to open new browser window on button click event?
body: <p>How to open new browser window on button click event in C# ASP.NET?</p>
  
  <p>Please share any example.</p>
  
  <p>I am doing following code. Please let me know where I am going wrong.</p>
  
  <pre><code>btn_Click()
  {
      if(condition==true)
      {
          this.Page.ClientScript.RegisterStartupScript(
              this.GetType(),
              "page_index_script2", 
              "openNewWindow();", 
              true
          );
      }
  }
  </code></pre>
  
  <p>And the JavaScript function is </p>
  
  <pre><code>function openNewWindow()
  {
      alert('HI');
      window.open('http://www.stackoverflow.com');  
  }
  </code></pre>
  
  <p>When I run the code from javascript function Alert works but new window is not getting opened.</p>