Reputation: 4546
How can I disable client-side form validation in my ASP.NET Core 1.1 app? But I need the server-side one.
Upvotes: 8
Views: 6099
Reputation: 22860
In Razor Pages
services.Configure<HtmlHelperOptions>(o => o.ClientValidationEnabled = false);
See Disable client-side validation
Upvotes: 1
Reputation: 271
You do this in your ConfigureServices class in your Startup file:
services.AddMvc().AddViewOptions(options =>
options.HtmlHelperOptions.ClientValidationEnabled = false);
This will work for the attributes generated by tag helpers.
Upvotes: 10
Reputation: 36736
you just remove the javascript for jquery.unobtrusive.validation.js
In the VS project templates that is in _ValidationScriptsPartial.cshtml
Upvotes: 7