J
Jon Davis
This is always returning True, even when fields are empty. Why?
private bool ValidatePageOne() {
bool ret = true;
foreach (Control ctrl in PageOnePanel.Controls) {
if (ctrl.GetType().IsSubclassOf(typeof(BaseValidator))) {
((BaseValidator)ctrl).Validate();
if (!((BaseValidator)ctrl).IsValid)
ret = false;
}
}
return ret;
}
private bool ValidatePageOne() {
bool ret = true;
foreach (Control ctrl in PageOnePanel.Controls) {
if (ctrl.GetType().IsSubclassOf(typeof(BaseValidator))) {
((BaseValidator)ctrl).Validate();
if (!((BaseValidator)ctrl).IsValid)
ret = false;
}
}
return ret;
}