Validating two usercontrols
Dates, strings and other value types can be compared as well.
Now, try running the website, and test the two new fields.
It might seem a bit overwhelming, but it's actually quite simple.
Like with the Required Field Validator, we use the controltovalidate attribute to specify which control to validate.
I have it registered and loaded in my aspx page as dd Something. Instead, within your own evaluation function you will access the Drop Down List through the User Control.In your case, you have the validator on the Page (using the Page as the Naming Container). I've been having some trouble with an int field and the Validator. I post it now cause I have about an age trying to find some way to tell the Required Field Validator to do it against a value (say: 0) with some sort of annotation or something but no way... Hope it helps some NUGGET like me I've been having some trouble with an int field and the Validator. I post it now cause I have about an age trying to find some way to tell the Required Field Validator to do it against a value (say: 0) with some sort of annotation or something but no way... Hope it helps some NUGGET like me If you've questions, please don't open (related) old posts, but start a new thread! Together with a required filed validator, also add a compare validator if you want the value to be a specific type (in this case integer) and with a minimum value (0).If you want also a maximum value, then use a rangevalidator.How can I get the Required Field Validator to validate my user control along with the rest of the server controls in my webform? Bob Gibilaro You need to apply Validation Property attribute to your user control, its value pointing to the name of the property which will be validated by the validation control. Suppose that property is called "DDLValue", add this line above the User Control's class definition (shown in VB. Here's a nice example of what I did for #2 that worked perfectly (this is in C#).This way validation control at server-side knows which property to look for when validating. NET): Public Class Myuser Control Inherits User Control Since your User Control doesn't generate this property on the client-side, you must turn off client side validation on that validator. FYI: I make a replacement to Microsoft's validators that solves most of the issues users face. I set DOSmust Be Valid as appropriate for my purposes.