Disable client side form validation in ASP.NET Core 1.1

How can I disable client-side form validation in an ASP.NET Core 1.1 app? But I need a server one.

+4


source to share


3 answers


you just remove the javascript for jquery.unobtrusive.validation.js



In VS project templates which are in _ValidationScriptsPartial.cshtml

+3


source


You do this in your ConfigureServices class in your startup file:

services.AddMvc().AddViewOptions(options => 
    options.HtmlHelperOptions.ClientValidationEnabled = false);

      



This will work for attributes generated by the tag helpers.

+4


source


In the shaving pages

services.Configure<HtmlHelperOptions>(o => o.ClientValidationEnabled = false);

      

See Disabling Client Side Validation.

0


source







All Articles