Custom Composite Web Control and Validator

R

Rick

Hello,

I built a composite web control that has a textbox and a date
control.
added my custom control on a webform where there are other standard
controls.
Each control on the form has a required validator.
I need to have a validator for my custom control, but don't know how
to do this.
I added a CustomValidator to the form, but in design mode, my custom
control doesn't appear in the list of controls of the validator.
Any help to work around this will be greatly appreciated.

Thanks,

Rick
 
R

Riki

Rick said:
Hello,

I built a composite web control that has a textbox and a date
control.
added my custom control on a webform where there are other standard
controls.
Each control on the form has a required validator.
I need to have a validator for my custom control, but don't know how
to do this.
I added a CustomValidator to the form, but in design mode, my custom
control doesn't appear in the list of controls of the validator.
Any help to work around this will be greatly appreciated.

For a CustomValidator, there's no need to indicate a ControlToValidate.
Just leave it blank.
It's your custom validation code that will decide which values it's going to
check.
 
R

Rick

For a CustomValidator, there's no need to indicate a ControlToValidate.
Just leave it blank.
It's your custom validation code that will decide which values it's going to
check.

Hi Riki,

Thanks. I did as you said, and set the args.IsValid accordingly in the
custom validator's event handling sub, but I must be missing something
b/c the event for the custom validator isn't getting fired. I have a
breakpoint in this event and it isn't stopping there. I'm new to aspx
and I'd appreciate any help to make this user control work with the
validator.

Thank you in advance,

Rick
 

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,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top