validationgroup property origin ?

F

fredd00

Hi

I'm wondering in which class or interface the validationgroup property
originates.

i have created a web user control that uses the validation group
property on textboxes, dropdownlist, validators etc..
the problem is that on my page i have to put 2 of those web user
control
when i submit one the other fails to validate

how can i set different validation group per web user control

i wanted to iterate the controls to set their validationgroup by
calling a method :

protected void SetValidationGroup()
{
foreach (Control ctl in this.Controls)
{
BaseValidator bv = ctl as BaseValidator;
if (bv != null)
{
bv.ValidationGroup = this.ClientID + "VG1";
}
}
}

the problem is that the BaseValidator Class is only for validator
controls, I want to set it for all controls that implement
validationgroup

which class should I use or is there an other way to have 2 user
control and only have one to validate at a time

thanks
 
B

bruce barker

you are confused. the ValidationGroup property is on validators
(BaseValidator) or controls that fire validation on postback
(IButtonControl). TextBoxes and dropdownlists do not have a validationgroup.

-- bruce (sqlwork.com)
 

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

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,708
Latest member
SherleneF1

Latest Threads

Top