N
Nathan Sokalski
I am writing a Validator by inheriting from the BaseValidator class. I need
to access the control referred to by the ControlToValidate property. Because
ControlToValidate is a String, I will need to use the FindControl() method
using ControlToValidate as the argument. In most cases, this would work
perfectly fine, but as most of us know, there are some scenarios (such as
those involving Master pages) in which the NamingContainers can make this
harder than we would like. The GetControlValidationValue() method obviously
needs to reference the ControlToValidate control when it gets the validation
value, so I am wondering if there is some hidden way to make it easier to
get the ControlToValidate control in a Validator, since they are often used
together. Any help would be appreciated. Thanks.
to access the control referred to by the ControlToValidate property. Because
ControlToValidate is a String, I will need to use the FindControl() method
using ControlToValidate as the argument. In most cases, this would work
perfectly fine, but as most of us know, there are some scenarios (such as
those involving Master pages) in which the NamingContainers can make this
harder than we would like. The GetControlValidationValue() method obviously
needs to reference the ControlToValidate control when it gets the validation
value, so I am wondering if there is some hidden way to make it easier to
get the ControlToValidate control in a Validator, since they are often used
together. Any help would be appreciated. Thanks.