Monthly Archives: August 2013

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 »

RangeValidator control in ASP.NET

RangeValidator validation control in ASP.NET is used to validate whether the value of a control is in a given range. It can validate Currency, Date, Double, Integer and String value. Properties of RangeValidator control Property Uses ControlToValidate It takes ID of the control you want to validate Type It specifies the type of data you… Read More »

CompareValidator control in ASP.NET

CompareValidator validation control in ASP.NET is used to validate an input control’s value by comparing it with another control’s value or a constant value. For example, we can use CompareValidator to validate controls if we want user to enter same value in two different controls, to compare value of a control with another control, to… 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 »