Let suppose I have a textbox for email and I want to validate that user must enter valid email address. In this statement there are two checks:
- User must enter email address – Required field
- Email address must valid email address
If we do this then email validation message shown far from the text box because RequiredFieldValidator still maintain their place.
Set the Display property to Dynamic on RequiredFieldValidator and RegularExpressionValidator. After doing this it render correctly.