title: C# code behind for Button Click Event, ASP.NET
body: <p>I'm working with HTML provided by coworker in .aspx and I need to program in .aspx.cs(C#) the functionality of the button he created using HTML.
  The code I'm dealing with is as follows:</p>
  
  <pre><code>&lt;div&gt;
      &lt;button style="padding: 10px; margin-bottom: 10px;" class="w3-round w3-blue"&gt;Ship&lt;/button&gt;
      &lt;button style="padding: 10px; margin-bottom: 10px;" class="w3-round w3-blue"&gt;Rate&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I'm new to HTML but in looking at solutions to similar questions I often see the HTML code for a functional button looking more like</p>
  
  <pre><code>&lt;button type="submit" runat="server" id="btnLogin" class="button" onclick="btnLogin_Click();"&gt;
  </code></pre>
  
  <p>and sometimes with an </p>
  
  <pre><code>&lt;asp:
  </code></pre>
  
  <p>at the beginning.  I've tried simply adding the runat and onclick fields to the HTML that correspond with a C# method in the aspx.cs code behind but I haven't been able to make the button click actually trigger the method in the code behind.  I've assumed that if I add the method with the name that follows onclick to the C# aspx.cs code then it would simply execute this upon the clicking of the button but I'm clearly mistaken.</p>
  
  <p>Can I program the button's functionality in the code behind without changing the HTML provided to me? Or must I alter the HTML first and if so how?</p>