VALIDATE ASP.NET CONTROLS

Carl Pieterson

Total Post:14

Points:98
Posted by  Carl Pieterson
 1663  View(s)
Ratings:
Rate this:

Here I just want to ask,

How to validate asp.net controls dynamically using validation controls such as RequiredFieldValidator etc. of asp.net

Thanks in advance.

  1. Chris Anderson

    Post:65

    Points:455
    Re: Validate ASP.NET Controls

    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

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!