title: Gridview Delete Linkbutton not firing RowDeleting Event
body: <p>I am so frustrated. Using asp.net GridView. Using a LinkButton with the CommandName="Delete". Don't understand why the page isn't posting back. I've done this a million times in other apps. I've compared them against one another and nothing appears different. I will preface by saying this IS someone else's template, however, so it's not my same template.</p>
  
  <p>Any ideas what might be causing my issues?</p>
  
  <p>My scenario is this:</p>
  
  <p>ASPX Page (edited to add the HTML; there's more HTML in the site.Master and there's also a tag for the AjaxControlToolkit at the top of the page):</p>
  
  <pre><code>&lt;div class="width80 container body-content"&gt;
      &lt;h2 class="marginTop50"&gt;Message Board&lt;/h2&gt;
      &lt;asp:Panel ID="pnlMsgsForUser" runat="server" Visible="false"&gt;
          &lt;div class="jumbotronSmallFont"&gt;
              &lt;asp:Label ID="lblErrorMessage" CssClass="has-error" runat="server"&gt;&lt;/asp:Label&gt;
          &lt;/div&gt;
      &lt;/asp:Panel&gt;
  
      &lt;div class="jumbotronSmallFont"&gt;
          &lt;h4&gt;New Message&lt;/h4&gt;
          &lt;form&gt;
              &lt;div class="form-group"&gt;
                  &lt;label for="messageBody"&gt;Message Body&lt;/label&gt;
                  &lt;textarea class="form-control" id="messageBody" rows="3" style="max-width: 600px;"&gt;&lt;/textarea&gt;
              &lt;/div&gt;
              &lt;div class="text-center"&gt;
                  &lt;button id="btnSave" class="btn btn-primary" style="width: 75px;"&gt;Save&lt;/button&gt;
                  &lt;button type="button" id="btnReset" class="btn btn-default marginLeft15px" style="width: 75px;"&gt;Reset&lt;/button&gt;
              &lt;/div&gt;
          &lt;/form&gt;
      &lt;/div&gt;
  
      &lt;div&gt;
          &lt;asp:GridView ID="gvMessages" runat="server" Width="100%"
              CssClass="table adminMessageBoardTable marginAuto" AutoGenerateColumns="False"
              OnRowUpdating="gvMessages_RowUpdating"
              OnRowCancelingEdit="gvMessages_RowCancelingEdit"
              OnRowDataBound="gvMessages_RowDataBound"
              OnRowEditing="gvMessages_RowEditing"
              OnRowDeleting="gvMessages_RowDeleting"
              DataKeyNames="Id" BorderStyle="NotSet"&gt;
              &lt;Columns&gt;
                  &lt;asp:TemplateField HeaderText="Message" HeaderStyle-CssClass="center" SortExpression="Message"&gt;
                      &lt;EditItemTemplate&gt;
                          &lt;asp:TextBox ID="txtMsg" Width="100%" runat="server"&gt;&lt;/asp:TextBox&gt;
                      &lt;/EditItemTemplate&gt;
                      &lt;ItemTemplate&gt;
                          &lt;asp:Label runat="server" Text='&lt;%# Eval("MessageBody") %&gt;' ID="lblMessage"&gt;&lt;/asp:Label&gt;
                      &lt;/ItemTemplate&gt;
                  &lt;/asp:TemplateField&gt;
  
                  &lt;asp:TemplateField HeaderText="Date Updated" SortExpression="DateUpdated" HeaderStyle-CssClass="center" ItemStyle-CssClass="center"&gt;
                      &lt;HeaderStyle Width="120px" /&gt;
                      &lt;EditItemTemplate&gt;
                          &lt;asp:Label runat="server" ID="lblEditDateUpdated" Enabled="false"&gt;&lt;/asp:Label&gt;
                      &lt;/EditItemTemplate&gt;
                      &lt;ItemTemplate&gt;
                          &lt;asp:Label runat="server" Text='&lt;%# Eval("DateUpdated","{0:d}") %&gt;' ID="lblDateUpdated"&gt;&lt;/asp:Label&gt;
                      &lt;/ItemTemplate&gt;
                  &lt;/asp:TemplateField&gt;
  
                  &lt;asp:TemplateField HeaderText="Updated By" SortExpression="UpdatedBy" HeaderStyle-CssClass="center" ItemStyle-CssClass="center"&gt;
                      &lt;HeaderStyle Width="120px" /&gt;
                      &lt;EditItemTemplate&gt;
                          &lt;asp:Label runat="server" Text="" ID="lblEditUpdatedBy" Enabled="false"&gt;&lt;/asp:Label&gt;
                      &lt;/EditItemTemplate&gt;
                      &lt;ItemTemplate&gt;
                          &lt;asp:Label runat="server" Text='&lt;%# Eval("UpdatedBy") %&gt;' ID="lblUpdatedBy"&gt;&lt;/asp:Label&gt;
                      &lt;/ItemTemplate&gt;
                  &lt;/asp:TemplateField&gt;
  
                  &lt;asp:TemplateField ItemStyle-CssClass="center"&gt;
                      &lt;HeaderStyle Width="120px" /&gt;
                      &lt;EditItemTemplate&gt;
                          &lt;asp:LinkButton ID="lbUpdate" runat="server" CausesValidation="True"
                              CommandName="Update" Text="Update"
                              OnClientClick="return confirm('You are about to update this entry.  \n\nDo you wish to proceed?');"&gt;&lt;/asp:LinkButton&gt;
                          &amp;nbsp;&lt;asp:LinkButton ID="lbCancel" runat="server" CausesValidation="False"
                              CommandName="Cancel" Text="Cancel"&gt;&lt;/asp:LinkButton&gt;
                      &lt;/EditItemTemplate&gt;
                      &lt;ItemTemplate&gt;
                          &lt;asp:LinkButton ID="lbEdit" runat="server" CausesValidation="False"
                              CommandName="Edit" Text="Edit"&gt;&lt;/asp:LinkButton&gt; &amp;nbsp; &amp;nbsp;
                          &lt;asp:LinkButton ID="lbDelete" runat="server" CommandArgument='&lt;%# Eval("Id") %&gt;' CausesValidation="False" 
                              CommandName="Delete" Text="Delete" OnClientClick="return confirm('You are about to delete this entry. \n\Do you wish to proceed?');"&gt;&lt;/asp:LinkButton&gt;
                      &lt;/ItemTemplate&gt;
                  &lt;/asp:TemplateField&gt;
  
              &lt;/Columns&gt;
          &lt;/asp:GridView&gt;
  
      &lt;/div&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>In my code-behind, I have:</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
      {
          if (!Page.IsPostBack)
          {
              var user = CommonFunctions.GetUserID(true);
              var Admin = Roles.IsUserInRole(user, "Administrator");
              var Dev = Roles.IsUserInRole(user, "Developer");
  
              if (!Admin &amp;&amp; !Dev)
              {
                  Response.Redirect("~/");
              }
  
              gvBind(true);
          }
      }
  </code></pre>
  
  <p>When I click on the Delete linkbutton for a row, it drops into the Page_Load and </p>
  
  <pre><code>!Page.IsPostBack 
  </code></pre>
  
  <p>verifies as <strong>true</strong>. I have no idea why it's doing this. It also never even hits the RowDeleting command. My breakpoint is so sad.</p>
  
  <p>In my other app, all the markup and code-behind are pretty much the same. The only differences are the gridview name and the Eval tags. But when I click Delete in that app, it skips the !Page.IsPostBack section. :( It also obviously fires the RowDeleting.</p>
  
  <p>I've also tried implementing RowCommand, but that event never fires either. It only does Page_Load and RowDataBound before essentially refreshing the page.</p>
  
  <p>Any ideas?</p>
  
  <p>Please, and thanks!!!</p>