Wednesday, 24 February 2021

MVC - Fix Error - JavaScript runtime error: Unable to get property 'unobtrusive' of undefined or null reference

 Watch this example on YouTube


 


To fix it replace in Layout

 
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/Scripts/CustomValidationF.js")
    @Scripts.Render("~/bundles/bootstrap")
    @RenderSection("scripts", required: false)
</body>
</html>

with

 
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/jqueryval")
    @Scripts.Render("~/Scripts/CustomValidationF.js")
    @Scripts.Render("~/bundles/bootstrap")
    @RenderSection("scripts", required: false)
</body>
</html>

 

No comments:

Post a Comment