P
Peter Young
I would like to have my control provide a Required property, and if this
property is true, attach a RequiredFieldValidator.
This approach works fine for a 'simple' control, but it fails for a
composite control, where the control is implementing INamingContainer.
It appears that the problem is inside of the system base validator - it is
looking for the ControlToValidate like so:
this.NamingContainer.FindControl(name)
In this case, the naming container is the control it's trying to find, so it
can't find it. It needs to search the parent naming container.
Has anyone else run into this and found a simple workaround?
Thanks for any help,
Pete
property is true, attach a RequiredFieldValidator.
This approach works fine for a 'simple' control, but it fails for a
composite control, where the control is implementing INamingContainer.
It appears that the problem is inside of the system base validator - it is
looking for the ControlToValidate like so:
this.NamingContainer.FindControl(name)
In this case, the naming container is the control it's trying to find, so it
can't find it. It needs to search the parent naming container.
Has anyone else run into this and found a simple workaround?
Thanks for any help,
Pete