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

Top