two decisons just one button
<p>My problem now is that i need to click 2 time to do the search with right text to search. is there a way to cacth what i'm sending and update it? Is there another solution?</p>

<p>Hello!!</p>

<p>I have 2 radiobuttons that decides what search engine to use (google or mine), and i have 1 button that will submit a text that will be used to be searched in one of the 2 search engines. When i try to do the google search, the first time it just opens the new window when i click the 2nd time, it opens the google window with word that i want to search and if i try to do my search it do the both searchs. What i'm doing wrong ? how i put this working in the right way?</p>

<pre><code>  &lt;table&gt;&lt;tr&gt;
  &lt;td&gt;
      &lt;asp:TextBox ID="TextBox1" runat="server" &gt;&lt;/asp:TextBox&gt;
      &lt;asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="Button1_Click" UseSubmitBehavior="true"/&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr align="center"&gt;
  &lt;td&gt;
      &lt;input id="Search1" value="one" type="radio" runat="server" name="sitesearch" /&gt;Site Name
      &lt;input id="Search2" value="two" type="radio" runat="server" name="sitesearch" /&gt;           
      &lt;img src="http://www.google.com/images/poweredby_transparent/poweredby_FFFFFF.gif" alt="Google" /&gt;
  &lt;/td&gt;      
  &lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>and then i have...</p>

<pre><code>protected void Button1_Click(object sender, EventArgs e){

        if (Search1.Checked)
        {
            //My Search
            Response.Redirect(Request.UrlReferrer.AbsolutePath +...
        }
        else if (Search2.Checked)
        {
            //Google search
            btnSearch.Attributes.Add("OnClick", "window.open('http://www.google.com/search?q=" + Regex.Replace(TextB.Text, " ", "+") + "','_blank');");
        }
    }
</code></pre>

<p>...and i have this...</p>

<pre><code>TextBox TextB;    
HtmlInputRadioButton radioBSite;
Button btnSearch;
HtmlInputRadioButton radioBGoogle;

protected override void OnInit(EventArgs e)
{
    base.OnInit(e);
    TextB = (TextBox)FindControl("TextBox1");
    TextB.Text = Request["find"];
    radioBSite = (HtmlInputRadioButton)FindControl("Search1");
    radioBSite.Checked = true;
    radioBGoogle = (HtmlInputRadioButton)FindControl("Search2");

    btnSearch = (Button)FindControl("btnSearch");
    btnSearch.Click += new EventHandler(Button1_Click);
    .
    .
}
</code></pre>
