D
Donal McWeeney
The ControlToValidate property is wrecking my head.
I have a custom composite server control defined as follows:
internal abstract class MyControlBase : Control, INamingContainer
{...}
[ValidationProperty("ValidationValue")]
internal class MyControl : MyControlBase
{...}
MyControl in its CreateChildControls method creates the following:
- an array of RadioButton control
- a TextBox
- a custom validator that I have written.
If I set the validator ControlToValidate property to the TextBox it works
fine however it may not be created or rendered. The only thing I can be
guarnteed of rendering is the array or RadioButtons.
If I set the validator ControlToValidate to the ID of the instance of
MyControl I get the following error:
Unable to find control id 'idMyControl' referenced by the
'ControlToValidate'
property of 'idMyControl-rfv'.
Must ControlToValidate refer to a child of the naming container or can it be
the control that implements the naming container?
Is it possible in my custom validator to tell the base validator code not to
worry about the ControlToValidate property...
Help!!! Going beserk...
Thanks
Donal
I have a custom composite server control defined as follows:
internal abstract class MyControlBase : Control, INamingContainer
{...}
[ValidationProperty("ValidationValue")]
internal class MyControl : MyControlBase
{...}
MyControl in its CreateChildControls method creates the following:
- an array of RadioButton control
- a TextBox
- a custom validator that I have written.
If I set the validator ControlToValidate property to the TextBox it works
fine however it may not be created or rendered. The only thing I can be
guarnteed of rendering is the array or RadioButtons.
If I set the validator ControlToValidate to the ID of the instance of
MyControl I get the following error:
Unable to find control id 'idMyControl' referenced by the
'ControlToValidate'
property of 'idMyControl-rfv'.
Must ControlToValidate refer to a child of the naming container or can it be
the control that implements the naming container?
Is it possible in my custom validator to tell the base validator code not to
worry about the ControlToValidate property...
Help!!! Going beserk...
Thanks
Donal