Gridview text box edit
I have a textbox inside the gridview. IF i en开发者_StackOverflowter any non-numeric values it has to show error message. How to handle this in row edit event
You need a RegularExpressionValidator to check for numeric value.
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="TextBox1"
ErrorMessage="Enter only Numbers" ValidationExpression="[0-9]*"></asp:RegularExpressionValidator>
Don't forget to add a RequiredFieldValidator too, if empty Text is also invalid.
精彩评论