This is a bit hacky, but it will work:
Add the following Javascript function:
function submitValidate() { var isValid = Page_ClientValidate(''); if (!isValid) { setTimeout("$('#vsumAll ul li:not(:first)').remove()", 5); } return isValid; }
In your submit button add this:
<asp:Button runat="server" ID="btnSave" Text="Save" OnClientClick="submitValidate();"/>
Lastly, make sure you have ClientIDMode="Static" on ValidationSummary
Explanation
It uses jQuery to remove everything except the first li in the ValidationSummary, which is actually an UnorderedList (like ul ).
I put it in 5ms setTimeout , since we want it to start only after ValidationSummary has finished adding all the elements to ul .
The code will only work if Page_ClientValidate - this is the function that performs the ClientSide check.
Blachshma Nov 26 2018-12-12T00: 00Z
source share