title: Selecting from dropdownlist causes page to open in new window
body: <p>I have an asp.net page using vb.net. There is a linkbutton that opens up a store's website in a separate tab. This is done using Javascript. There is also a dropdownlist that contains coat sizes. The dropdownlist posts back.</p>
  
  <p>Here is the problem I'm having.</p>
  
  <p>The user clicks on the linkbutton that takes him to the store's website in a separate tab. The store's website does in fact come up in a tab. However "AFTER" the user does this, if the user selects a size from the dropdownlist the original page opens up in a new tab. This should not happen. Selecting a coat size from the dropdownlist should not cause the original page to open in a new tab after clicking on the linkbutton. Can someone let me know how to solve this? Thanks in advance.</p>
  
  <p>Server Code Below.</p>
  
  <pre class="lang-vb prettyprint-override"><code>Protected Sub DropDownList1_SelectedIndexChanged(sender As Object, e As System.EventArgs)
      Dim size As String
      size = DropDownList1.SelectedValue
  End Sub
  
  Protected Sub LinkButton1_Click(sender As Object, e As System.EventArgs)
      Dim link As String
      link = "http://"
      link = link + "www.google.com"
      Response.Redirect(link)
  End Sub
  </code></pre>
  
  <p>Page Code Below.</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
      &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
          &lt;asp:DropDownList ID="DropDownList1" runat="server" 
              onselectedindexchanged="DropDownList1_SelectedIndexChanged" AutoPostBack="True"&gt;
              &lt;asp:ListItem&gt;Sm&lt;/asp:ListItem&gt;
              &lt;asp:ListItem&gt;Med&lt;/asp:ListItem&gt;
              &lt;asp:ListItem&gt;Lg&lt;/asp:ListItem&gt;
              &lt;asp:ListItem&gt;XLg&lt;/asp:ListItem&gt;
          &lt;/asp:DropDownList&gt;
  
          &lt;br /&gt;&lt;br /&gt;
  
          &lt;asp:LinkButton ID="LinkButton1" runat="server" 
              onclick="LinkButton1_Click" OnClientClick="SetTarget();"&gt;LinkButton&lt;/asp:LinkButton&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  
  &lt;script type = "text/javascript"&gt;
  
      function SetTarget() {
          document.forms[0].target = "_blank";
      }
  &lt;/script&gt;
  &lt;/html&gt;
  </code></pre>