ASP.Net assign event handler to asp button click
<p>this is my code </p>

<pre><code>&lt;asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent"&gt;
    &lt;div&gt;
       &lt;asp:Table id="tb" runat="server" Height="239px" Width="417px" &gt;

       &lt;/asp:Table&gt;

           &lt;/div&gt;
    &lt;table&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;asp:Button ID="Votes" runat="server" Text="Vote" OnClick="Votes_Click" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;

&lt;/asp:Content&gt;
</code></pre>

<p>But when I click the button in debugging  it execute page_load event not Votes_Click event</p>

<p>why it does that???
and how to solve this problem???</p>

<p>and the handle on code behind page is</p>

<pre><code>protected void Votes_Click(object sender, EventArgs e)
        {
            ClientScript.RegisterClientScriptBlock(this.GetType(), "btn",

     "&lt;script type = 'text/javascript'&gt;alert('Button Clicked');&lt;/script&gt;");
            int i = 0;
            Response.Redirect("Default.aspx");

        }
</code></pre>
