0

Im catching the Html.ValidationSummary in a toastr notification which works fine, Issue i have is that it keeps showing a blank error toastr notification on page load.

Ive removed the onload class from my body tag in the page layout, but no luck.

Source,

        var message = @Html.Raw(Json.Encode(((@Html.ValidationSummary()==null)?"":@Html.ValidationSummary().ToHtmlString())));
if (message.length > 0) {
    toastr.error(message);
    }

I have already tried using toastr.remove();but had no luck.

surGe
  • 135
  • 2
  • 11

0 Answers0