1 I dont think that you can get that directly as like some control's error count..
But you can do one thing, if you just need the count.
Put ValidationSummary control on a page.
If there are any errors on Page then Validationsummary control will display all errors as a list.
So in javascript function, get the innerHtml of the validationSummary and get the count of <li>, that will be your error count.
var obj = document.getElementById("ValidationSummary1");
var errorCount = obj.innerHTML.split("<li>").length - 1;
alert('Page is not valid! ' + errorCount + ' Errors');
Thanks,
Please mark this answer as accepted answer if it resolves your problem.
Accepted 0 You can call it from any event, but I think it's make sense to call on client click event of form Submit button. So that you can validate the page and let user know the error(s).
0 your solution worked fine. Thank you.
I putted javascript on button client click event. But is there any other event where I can put this script to count errors.