Thursday, October 24, 2013

How to hide Validation Summary from JavaScript in .NET?

Here is how you can hide validation summary using the below JavaScript.  Call this in your aspx page. This should do trick for you.

function HideValidationSummary(){

if (typeof(Page_ValidationSummaries)!= "undefined"){ //hide the validation summaries
for (sums = 0; sums < Page_ValidationSummaries.length; sums++) {
summary = Page_ValidationSummaries[sums];
summary.style.display = "none";
}
}

}

It works in IE and Mozilla. Hope this helps

 

No comments:

Post a Comment