title: Difference between button and asp:button onclick
body: <p>I am new to developing in asp.net for making web sites.</p>
  <p>What is the difference between an <code>asp:Button</code> and an input button?</p>
  <p><strong>Code 1</strong><br />
  aspx code</p>
  <pre><code>&lt;asp:Button ID=&quot;Button1&quot; runat=&quot;server&quot; onclick=&quot;Button1_Click&quot; Text=&quot;Button&quot; /&gt;  
  </code></pre>
  <p>Codebehind</p>
  <pre><code>protected void Button1_Click(object sender, EventArgs e)
  {
      //Do somthing
  }  
  </code></pre>
  <p><strong>Code 2</strong><br />
  aspx code</p>
  <pre><code>&lt;input id=&quot;Submit1&quot; type=&quot;submit&quot; value=&quot;submit&quot; onclick=&quot;return Submit1_onclick()&quot; /&gt;  
  
  
  &lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;
  // &lt;![CDATA[
  
  function Submit1_onclick() {
      //Do somthing
  }
  
  // ]]&gt;
  &lt;/script&gt;
  </code></pre>