title: ASP.NET - Adding an UpdatePanel trigger to a LinkButton inside a gridview
body: <p>I was trying to update the content of a modal dialog, and this code works for me:</p>
  
  <pre><code>&lt;asp:LinkButton ID="updateSomething" runat="server" Text="Update" CausesValidation="false" OnClientClick="openDialog();" onclick="UpdateButton_Click" /&gt;
  
  &lt;asp:UpdatePanel ID="upNewUpdatePanel" runat="server"&gt;
      &lt;ContentTemplate&gt;
          &lt;asp:Label ID="updateLabel" runat="server"&gt;&lt;/asp:Label&gt;
      &lt;/ContentTemplate&gt;
      &lt;Triggers&gt;
          &lt;asp:AsyncPostBackTrigger ControlID="updateSomething" EventName="Click" /&gt;
      &lt;/Triggers&gt;
  &lt;/asp:UpdatePanel&gt;
  </code></pre>
  
  <p>However, when I try to place the LinkButton inside a gridview, like so:</p>
  
  <pre><code>&lt;asp:GridView ID="grdListUsers" runat="server" AutoGenerateColumns="false" AllowPaging="false" OnRowDataBound="grdRowDefListUsers" CssClass="mGrid" EmptyDataText="No users."&gt;
      &lt;Columns&gt;
          &lt;asp:BoundField DataField="Name" HeaderText="Nome" HeaderStyle-Width="300" /&gt;
          &lt;asp:BoundField DataField="Login" HeaderText="Login" HeaderStyle-Width="300" /&gt;
          &lt;asp:TemplateField HeaderText="Options" HeaderStyle-Width="75" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle"&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:LinkButton ID="updateSomething" runat="server" Text="Update" CausesValidation="false" OnClientClick="openDialog();" onclick="UpdateButton_Click" /&gt;
          &lt;/asp:TemplateField&gt;
      &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>This does not work, I get an error saying: A control with ID 'updateSomething' could not be found for the trigger in UpdatePanel 'upNewUpdatePanel'.</p>
  
  <p>How can I use the ImageButton inside the gridview?</p>