F
Frank Rizzo
My web page is in the FlowLayout Mode. I have 2 validators for a
textbox field: a RequiredFieldValidator and RegularExpressionValidator –
essentially to make sure that the user entered something into the Email
textbox and to make sure that whatever is entered is syntactically a
valid email. How can I force the error to appear in the same place.
The designer will not let me place both validators into the same spot in
Flow Layout mode. As a result, depending on which validator is engaged
the error appears in a different location. The validator code is below.
<asp:RegularExpressionValidator
id="validateEmailRegEx"
runat="server"
ControlToValidate="txtEmail"
ErrorMessage="Bad email"
ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">
</asp:RegularExpressionValidator>
<asp:RequiredFieldValidator
id="validateEmail"
runat="server"
ControlToValidate="txtEmail"
ErrorMessage="Enter a valid (no, really) email.">
</asp:RequiredFieldValidator>
Thanks.
textbox field: a RequiredFieldValidator and RegularExpressionValidator –
essentially to make sure that the user entered something into the Email
textbox and to make sure that whatever is entered is syntactically a
valid email. How can I force the error to appear in the same place.
The designer will not let me place both validators into the same spot in
Flow Layout mode. As a result, depending on which validator is engaged
the error appears in a different location. The validator code is below.
<asp:RegularExpressionValidator
id="validateEmailRegEx"
runat="server"
ControlToValidate="txtEmail"
ErrorMessage="Bad email"
ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">
</asp:RegularExpressionValidator>
<asp:RequiredFieldValidator
id="validateEmail"
runat="server"
ControlToValidate="txtEmail"
ErrorMessage="Enter a valid (no, really) email.">
</asp:RequiredFieldValidator>
Thanks.