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.

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

  1. Benjamin O'Neill
    July 26, 2017 at 4:58 pm (7 years ago)

    what about in partial views / modal popups?

    Reply

Leave a Reply