For Programmers: Free Programming Magazines  


Home > Archive > ASP .NET Webcontrols > May 2005 > Can we have more than 1 'control to validate' for a single validat









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Can we have more than 1 'control to validate' for a single validat
Pradeep be

2005-05-19, 8:57 am

I am trying to implement a feautre where it would be easy if i could perform
validations on 2 controls using a single validation control(can be a custome
validation control)
Can we have more than 1 'control to validate' for a single validation control.

Is this possible

Thanks Pradeep

Steve C. Orr [MVP, MCSD]

2005-05-20, 4:00 pm

No, each validation control can only validate one control.

Here's more info:
http://SteveOrr.net/Articles/Validation.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net




"Pradeep be" <Pradeep be@discussions.microsoft.com> wrote in message
news:B32023CB-FCB1-4B2D-BC28-70DCEA8F2195@microsoft.com...
>I am trying to implement a feautre where it would be easy if i could
>perform
> validations on 2 controls using a single validation control(can be a
> custome
> validation control)
> Can we have more than 1 'control to validate' for a single validation
> control.
>
> Is this possible
>
> Thanks Pradeep
>



Peter Blum

2005-05-21, 3:57 pm

The ASP.NET validators cannot do that unless you use a CustomValidator to
built the logic yourself. You won't be able to assign the two controls to
the ControlToValidate property (since there is only one of these
properties). So you will have to hardcode the control reference into your
custom validator's evaluation function.

My Professional Validation And More (http://www.peterblum.com/vam/home.aspx)
is a replacement to the original validators designed to overcome its many
limitations and let you develop without all the custom code and hacks you
face now. It has 25 validators that support client-side validation on many
browsers. Its MultiConditionValidator is designed to let you merge the
evaluation logic of several validators into one boolean expression like
"RequiredField AND Compare to Value". You have one error message as a
result.
--
--- Peter Blum
www.PeterBlum.com
Email: PLBlum@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Pradeep be" <Pradeep be@discussions.microsoft.com> wrote in message
news:B32023CB-FCB1-4B2D-BC28-70DCEA8F2195@microsoft.com...
>I am trying to implement a feautre where it would be easy if i could
>perform
> validations on 2 controls using a single validation control(can be a
> custome
> validation control)
> Can we have more than 1 'control to validate' for a single validation
> control.
>
> Is this possible
>
> Thanks Pradeep
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com