Manual Validation in different control files

  • Thread starter Thread starter Guest
  • Start date Start date
The section I am interested in is this...

foreach (object item in Controls)
{
if (item.GetType().IsSubclassOf(typeof(BaseValidator)))
((BaseValidator)item).Enabled = false;
}

....and...

foreach (object item in Controls)
{
if (item.GetType().IsSubclassOf(typeof(BaseValidator)))
{
BaseValidator tmpValid = (BaseValidator)item;
tmpValid.Enabled = true;
tmpValid.Validate();

// change the isValid flag if any validator is invalid.
if (!tmpValid.IsValid)
isValid = tmpValid.IsValid;
}
}

Could anyone give me the vb.net equivalent?

Thanks,

Turpya
 
Back
Top