ASP.NET validation controls
- by mehmet6parmak
Hi All,
I want to use Validation Controls but I dont want them to show their Error Messages when
invalid data exist. Instead I'm going to iterate through the validation controls
and show error messages inside my little ErrorMessage Control
for (int i = 0; i < Page.Validators.Count; i++)
{
if (!Page.Validators[i].IsValid)
{
divAlert.InnerText = Page.Validators[i].ErrorMessage;
return false;
}
}
I'm doing this because i have little space to show the error message.
You can ask why are you using validation control if you dont want to show them
My asnwer is "I use them for validation logic they handle"
I looked the properties of the validation controls and cant find something that wil help me doing this.
Any Idea?
Thanks