Tag Archives: RequiredFieldValidator control in ASP.NET

Validating list controls in ASP.NET using RequiredFieldValidator

RequiredFieldValidator control can be used to validate ASP.NET list controls like DropDownList, ListBox and RadioButtonList so that they cannot be left blank. Users must select a value from these list controls when validation has been applied. To validate a list control, we need to set InitialValue property of the RequiredFieldValidator along with other properties. Let… Read More »

How to avoid space occupied by an inactive validation control in ASP.NET

A validation control occupies space even if it is not showing any error. This is because by default Display property of the validation control is set to Static. For example, if we take two validation controls, one RequiredFieldValidator and one RangeValidator and if any of the validation fails, both the validation controls will consume their… Read More »

Validation controls in ASP.NET

Data validation is very important while accepting input from user. There may be different business logic for validating data. Some basic validation would be to validate a field to accept only numbers or a valid email address or phone number of a country in a specific pattern etc. ASP.NET provides some built-in controls for this… Read More »