Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience

0

When I add @Scripts.Render("~/bundles/jqueryval") to the bottom in partialview I get warning in the log:

  

Synchronous XMLHttpRequest on the main thread is deprecated because of   its detrimental effects to the end user's experience.

This warning appears when you open modal bootstrap.

I need @Scripts.Render("~/bundles/jqueryval") to validate fields.

Here is the simple code in partialview:

@model Projeto.Models.ModeloModels
@using (Ajax.BeginForm("Ação", "Controller", new AjaxOptions{ OnSuccess = "OnSuccess"}))
    {
       @Html.AntiForgeryToken()
       @Html.ValidationSummary(true, "", new { @class = "text-danger" })
        ...
    }
@Scripts.Render("~/bundles/jqueryval")

When removing line: @Scripts.Render("~/bundles/jqueryval") the warning disappears. Does anyone know what this problem might be?

    
asked by anonymous 10.01.2017 / 19:14

1 answer

0

I solved the problem in a different way.

Removing the line: @Scripts.Render("~/bundles/jqueryval") .

And add this code in javascript:

<script type="text/javascript">
    $("form").removeData("validator");
    $("form").removeData("unobtrusiveValidation");
    $.validator.unobtrusive.parse("form");
</script>
    
10.01.2017 / 20:12