我有一个文本框 txtemailid,它有两个验证器RequiredFieldValidator
和RegularExpressionValidator
:
<asp:TextBox ID="txtEMailId" CssClass="Text1" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVtxtEMailId"
runat="server"
ErrorMessage="*"
Display="Dynamic"
ForeColor="Red"
ControlToValidate="txtEMailId"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="REVtxtEMailId"
runat="server"
ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
Display="Dynamic"
ErrorMessage="Invalid Email Format"
ForeColor="Red"></asp:RegularExpressionValidator>
它显示以下错误
The ControlToValidate property of 'REVtxtEMailId' cannot be blank.