How do I find the Client ID of control within an ASP.NET GridView?

<asp:TemplateField>
    <ItemTemplate>
        <asp:TextBox ID="textDateSent" runat="server">
        </asp:TextBox>                      
       <input type="button" value='Today' onclick="setToday('<%# ((GridViewRow)Container).FindControl("textDateSent").ClientID %>');" /> 
    </ItemTemplate>
</asp:TemplateField>

Comments

Popular posts from this blog

Executing PowerShell scripts from C#

HOW TO Use the NumericUpDown Control

Exposing Agile Software Development Myths