开发者

I want to apply a regularexpressionvalidator to selective fields in DetailsView ASP.NET 2.0 VB

Hello, I have been having trouble with this for a while now. I have a bound textbox within a Detailsview, to which I have added a RegularExpressionValidator (REV). The Regular Expression used is [a-zA-Z]*

After running the Web Form, the Edit button opens the fields. Any entries made cause the REV error msg to be displayed when the Update button is pressed, irrespective of the validation. The Update button continues to be displayed until the Cancel button is selected and the original 开发者_运维知识库record is returned to the screen replacing any entries.

The RequiredFieldValidator works correctly.

Ray Brown


I would suggest you FilteredTextBoxExtender of Ajax Control Toolkit instead of using REV.

It gives you the option to validate the input for many types of validation for numeric, letter, or even custom types for example:

<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>

<ajaxToolkit:FilteredTextBoxExtender ID="ftbe" runat="server"
    TargetControlID="TextBox3"         
    FilterType="LowercaseLetters, UppercaseLetters" />
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜