Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Custom Composite Web Control and Validator

Reply
Thread Tools

Custom Composite Web Control and Validator

 
 
Rick
Guest
Posts: n/a
 
      06-02-2007
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

 
Reply With Quote
 
 
 
 
Riki
Guest
Posts: n/a
 
      06-04-2007
Rick wrote:
> 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.

--

Riki


 
Reply With Quote
 
 
 
 
Rick
Guest
Posts: n/a
 
      06-11-2007
On Jun 4, 8:31 am, "Riki" <(E-Mail Removed)> wrote:
> Rick wrote:
> > 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.
>
> --
>
> Riki


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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Composite Custom Web Control and external Validator Rick ASP .Net Web Controls 0 06-02-2007 05:15 AM
Losing Composite Control property that another Composite Control ... Chad ASP .Net Building Controls 0 02-01-2005 09:01 PM
custom validator and ControlToValidate in a composite control... Donal McWeeney ASP .Net Building Controls 1 09-29-2004 08:45 AM
Possible to create a composite control that has a child control that is a validator that validates the composite control itself? Jonathan Eric Miller ASP .Net Building Controls 2 07-22-2004 10:58 PM
Using Table control in a custom composite control. Control does not render properly in design time. jb_in_marietta@yahoo.com ASP .Net 0 07-01-2003 09:26 PM



Advertisments