开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜