Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
ASP .Net
Adding validators to CompositeControl
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Mantorok, post: 1594725"] Hi all I finally got around to creating some WebControl classes, however I want to add some validation to my custom control, it's a descendant of CompositeControl. I get the exception: Unable to find control id 'txtForename' referenced by the 'ControlToValidate' property of 'valType' Here is how I'm creating the validtor(s): protected override void CreateChildControls() { // Create the custom validator CustomValidator customVal = new CustomValidator(); customVal.ID = ID_CUSTOMVAL; customVal.ServerValidate += new ServerValidateEventHandler(validator_ServerValidate); customVal.Text = TEXT_VALIDATOR; Controls.Add(customVal); // Create the compare validator CompareValidator typeVal = new CompareValidator(); typeVal.ID = ID_TYPEVAL; typeVal.Operator = ValidationCompareOperator.DataTypeCheck; typeVal.Text = TEXT_VALIDATOR; typeVal.ControlToValidate = ID; Controls.Add(typeVal); base.CreateChildControls(); } Any ideas? Thanks Kev [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
ASP .Net
Adding validators to CompositeControl
Top