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
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