---
title: "Validate ASP.NET Controls"  
description: "Validate ASP.NET Controls"  
author: "Anonymous User"  
published: 2011-11-30  
updated: 2011-11-30  
canonical: https://www.mindstick.com/forum/358/validate-asp-dot-net-controls  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# Validate ASP.NET Controls

Here I just want to ask,

How to [validate](https://www.mindstick.com/forum/1490/what-is-better-solution-for-validate-form-textboxs-value) [asp.net](https://www.mindstick.com/articles/934/default-folders-available-inside-the-asp-dot-net-application-folder) [controls](https://www.mindstick.com/articles/66/how-to-create-controls-at-run-time-in-csharp-dot-net) dynamically using [validation](https://www.mindstick.com/articles/12234/validation-using-data-annotation-using-entity-framework) controls such as [RequiredFieldValidator](https://www.mindstick.com/articles/993/login-form-using-asp-dot-net) etc. of asp.net

Thanks in advance.

## Replies

### Reply by Chris Anderson

hi carl,\
\
To validate the asp.net controls dynamically you can use the above code:\
\
RequiredFieldValidator required = new RequiredFieldValidator(); //create object\
required.ControlToValidate = "RadioButtonList1; //bind control\
required.ErrorMessage = "Choose option"; //specify message\
this.form1.Controls.Add(required); // add the control


---

Original Source: https://www.mindstick.com/forum/358/validate-asp-dot-net-controls

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
