<commit_before>---
title: Validation
page_title: Validation | UI for ASP.NET AJAX Documentation
description: Validation
slug: input/how-to/validation
tags: validation
published: True
position: 1
---

# Validation



## Validating entered values

The **RadInput** controls support ASP.NET validators (both client and server side). For example a **RequiredFieldValidator** can be used to make sure the user does not skip mandatory fields. A **RangeValidator** can be applied to ensure the entered value falls within some specified interval.

>note You can also use the **MaxDate** and **MinDate** properties on **RadDateInput** or the **MaxValue** and **MinValue** properties on **RadNumericTextBox** to restrict the input to a specified interval.
>


To use ASP.NET validators with **RadInput** controls, simply set the ID of the **RadInput** control as the value of the **ControlToValidate** property of the validator.

Since Q2 2012 thre are some modifications for RadInput validation.The main idea is to render only the input element all the time, and remove the span element and the excessive inputs. To be achieved this the validation value is stored in [“expando”](http://msdn.microsoft.com/en-us/library/89t1khd2%28v=vs.94%29.aspx)property and we submit real value through the client state. Also, the [ValidatorGetValue](http://msdn.microsoft.com/en-us/library/aa338815%28v=vs.71%29.aspx)function of the [asp:Validators](http://msdn.microsoft.com/en-us/library/debza5t0.aspx)was overriden to look our expando property called “RadInputValidationValue”.

## Example

![Validators](images/Validators.png)

The following declaration shows the use of a required field validator from the form above:

````ASPNET
	    <telerik:RadTextBox
	        id="RadTextBox1"
	        runat="server"
	        Skin="WebBlue">
	    </telerik:RadTextBox>
	    <asp:RequiredFieldValidator
	        ID="TextBoxRequiredFieldValidator"
	        Runat="server"
	        Display="Dynamic"
	        ControlToValidate="RadTextBox1"
	        ErrorMessage="The textbox can not be empty!" >
	    </asp:RequiredFieldValidator>
````



The following declaration shows the use of a range validator from the form above:

````ASPNET
	    <telerik:RadDateInput
	        ID="RadDateInput1"
	        style="font: 8pt monospace" runat="server"<commit_msg>RadInput - initial fixes after the migration<commit_after>---
title: Validation
page_title: Validation | UI for ASP.NET AJAX Documentation
description: Validation
slug: input/how-to/validation
tags: validation
published: True
position: 1
---

# Validation



## Validating entered values

The **RadInput** controls support ASP.NET validators (both client and server side). For example a **RequiredFieldValidator** can be used to make sure the user does not skip mandatory fields. A **RangeValidator** can be applied to ensure the entered value falls within some specified interval.

>note You can also use the **MaxDate** and **MinDate** properties on **RadDateInput** or the **MaxValue** and **MinValue** properties on **RadNumericTextBox** to restrict the input to a specified interval.
>


To use ASP.NET validators with **RadInput** controls, simply set the ID of the **RadInput** control as the value of the **ControlToValidate** property of the validator.

Since Q2 2012 thre are some modifications for RadInput validation.The main idea is to render only the input element all the time, and remove the span element and the excessive inputs. To be achieved this the validation value is stored in [“expando”](http://msdn.microsoft.com/en-us/library/89t1khd2%28v=vs.94%29.aspx) property and we submit real value through the client state. Also, the [ValidatorGetValue](http://msdn.microsoft.com/en-us/library/aa338815%28v=vs.71%29.aspx) function of the [asp:Validators](http://msdn.microsoft.com/en-us/library/debza5t0.aspx) was overriden to look our expando property called “RadInputValidationValue”.

## Example

![Validators](images/Validators.png)

The following declaration shows the use of a required field validator from the form above:

````ASPNET
	    <telerik:RadTextBox
	        id="RadTextBox1"
	        runat="server"
	        Skin="WebBlue">
	    </telerik:RadTextBox>
	    <asp:RequiredFieldValidator
	        ID="TextBoxRequiredFieldValidator"
	        Runat="server"
	        Display="Dynamic"
	        ControlToValidate="RadTextBox1"
	        ErrorMessage="The textbox can not be empty!" >
	    </asp:RequiredFieldValidator>
````



The following declaration shows the use of a range validator from the form above:

````ASPNET
	    <telerik:RadDateInput
	        ID="RadDateInput1"
	        style="font: 8pt monospace" runat="server"
{'fraction_non_alphanumeric': 0.0939640410958904, 'fraction_numerical': 0.014554794520547944, 'mean_word_length': 4.316268486916951, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3292857', 'n_tokens_mistral': 1367, 'n_tokens_neox': 1257, 'n_words': 489}