title: Event not firing on button click event
body: <p>This is a problem I haven't come across before.</p>
  
  <p>I'm working on an MVC4 project.  I'm using an asp button control because there isn't a Html Helper that can be used for a button (re: <a href="https://stackoverflow.com/questions/5955571/theres-no-html-button">There&#39;s no @Html.Button !</a>).  My button code is:</p>
  
  <pre><code>&lt;td&gt;&lt;asp:Button ID="ButtonUndo" runat="server" Text="Undo" 
                          OnClick="ButtonUndo_Click" AutoPostBack="true"/&gt;&lt;/td&gt;
  </code></pre>
  
  <p>I went to the Designer tab and clicked on this button which produced the event handler:</p>
  
  <pre><code>protected void ButtonUndo_Click(object sender, EventArgs e)
  {
      RRSPSqlEntities db = new RRSPSqlEntities();
      int id = (int)ViewData["ClientId"];
  
      var updateAddress = (from a in db.Address
                               where a.PersonId == id
                               select a).SingleOrDefault();
  
      updateAddress.Deleted = false;
      db.SaveChanges();
  }
  </code></pre>
  
  <p>I should add that this code was added to the same .aspx page wrapped in a script tag.  Also within this section is the Page_Load method. The eventhandler is not within Page_Load.  </p>
  
  <p>The problem was found when I set a breakpoint and stepped through the code.  Clicking my button shows that it doesn't hit my event handler at all.  I don't know why this is, particularly as ASP created the event from clicking the button in Design mode.  </p>