Create a property on your new user control that sets the validation group on the contained validator. Then from your markup, all you need to do is just set the ValidationGroup property on the control, and that'll roll to the validators contained in the user control. You likely don't need the interface or inheriting from BaseValidator unless you are creating JUST a validation user control.
Sample Code
public string ValidationGroup
{
get
{
return MyRequiredFieldValidator.ValidationGroup;
}
set
{
MyRequiredFieldValidator.ValidationGroup = value;
}
}
{
get
{
return MyRequiredFieldValidator.ValidationGroup;
}
set
{
MyRequiredFieldValidator.ValidationGroup = value;
}
}
Comments
Post a Comment