ASP.NET define input validators programmatically depending on configuration

I'm writing an ASP.NET 3.5 web application. There is a rather complex input form (30 input controls - TextBoxes, Dropdownlists, ...).

Now, different clients use the same form in their customized application and there are different mandatory fields for some clients.

Now, I'd like to programmatically create/activate certain validators depending on configuration settings, like (I'm simplifying here):

ControlsToValidateRequiredFields="NameTextBox,AddressTextBox,EmailTextBox"

and maybe for a second client:

ControlsToValidateRequiredFields="NameTextBox,PhoneTextBox"

Is there a ASP.NET-built-in way (or a 3rd party control) to do that? I'd like to avoid defining all validators on the page and disabling them. Can I dynamically create and attach Validators to existing controls?

Note: I'd like to validate on client-side. BTW: I'm using the ASP.NET Ajax ControlToolkit's ValidatorCalloutExtender - but it is not a must. And yes, a jQuery-based solution would be okay.

Answers


PeterBlum.com, thats all there is to say when it comes to 3rd party validation suites. Full featured client and serverside api,


Need Your Help

SOLR and PHP help needed

java php mysql database solr

I have understood how to add xml files to SOLR and be able to search them via the SOLR ADMIN interface...

It seems a browser ( or is it visual studio? ) is caching a stylesheet and thus any changes I make to

asp.net css browser caching themes

I’m using a stylesheet as part of a theme and it seems that both IE and Firefox ( or perhaps VS express edition) are caching this stylesheet, since any changes I make to a stylesheet ( such as

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.