ASP.NET defines input validators programmatically based on configuration

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

Now, different customers use the same form in their custom application and there are different required fields for some customers .

Now I would like to programmatically create / activate certain validators depending on the config settings , for example (I'm simplifying here):

ControlsToValidateRequiredFields="NameTextBox,AddressTextBox,EmailTextBox"

      

and maybe for a second client:

ControlsToValidateRequiredFields="NameTextBox,PhoneTextBox"

      

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

Note. I want to check client side. BTW: I am using ASP.NET Ajax ControlToolkit ValidatorCalloutExtender, but this is not required. And yes, a jQuery based solution will be fine.

+1


source to share


1 answer


PeterBlum.com, that's all there is to say when it comes to third-party verification packages. Full featured client and serveride api,



+1


source







All Articles