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" />
精彩评论