How to enable Unobtrusive Client Validation using JQuery in ASP.NET 5



In previous versions of ASP.NET MVC we have enable unobtrusive client side validation using JQuery in simple way by adding two keys in AppSettings of your config file:

<configuration>
  <appSettings>  
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
  </appSettings>
</configuration>

 

In ASP.NET MVC 6 process of enabling client side validation is even more simpler.

On views you want to enable unobtrusive client side validation just include:

@section scripts{
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
}

 

I hope this small blog post will help someone to save some time creating awesome ASP.NET MVC 6 apps.

If you like this article don’t forget to subscribe to this blog and make sure you don’t miss new upcoming blog posts.

  • Benjamin O’Neill

    what about in partial views / modal popups?