Chriz L

Chriz L

  • NA
  • 220
  • 50.9k

How to add Validator on Gridview TemplateField

Oct 6 2015 7:18 AM
Hello, 
I have this templatefield in a gridview
 
<asp:TemplateField HeaderText="HeaderText">
              <EditItemTemplate>
                <asp:TextBox ID="textbox1" runat="server" 
                       Text='<%# Bind("Field1") %>'></asp:TextBox>
              </EditItemTemplate>
              <ItemTemplate>
                     <asp:Label ID="Label1" runat="server" Text='<%# Bind("Field1") %>'></asp:Label>
              </ItemTemplate>
     <ItemStyle Width="100px" />
</asp:TemplateField>
 
how can I add a validator to check if it's valid number?
 
Thank you in advance. 

Answers (9)