Easy access to the control specified in a validator's ControlToValidate property

  • Thread starter Nathan Sokalski
  • Start date
N

Nathan Sokalski

I have a custom validator that inherits from BaseValidator, and I need to be
able to access the control specified by the ControlToValidate property. The
only way I have been able to find to do this is to recursively use the
FindControl method, which can sometimes be inefficient depending on where
the control is located. I'm sure I'm not the first person to want to access
the ControlToValidate control in a custom validator, so does anybody know of
a more efficient way? Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top