How to configure client validation in an ASP.NET MVC 2.0 application to recognize standard pt-BR

1

I am having difficulty configuring client-side validation of my application. I would like client validation, using jquery.validate.unobstrusive , to accept numbers and dates located in pt-BR.

I've already done this in the startup method of the application

var locale = "pt-BR";
RequestLocalizationOptions localizationOptions = new RequestLocalizationOptions {
    SupportedCultures   = new List<CultureInfo> { new CultureInfo(locale) },
    SupportedUICultures = new List<CultureInfo> { new CultureInfo(locale) },
    DefaultRequestCulture = new RequestCulture(locale)
};

and added <html lang="pt-br"> to the main HTML file.

It turns out that it worked fine for rendering server-side numbers and dates, but client-side validation is still waiting for inputs in en-US .

How can I configure the Asp.NET Core MVC 2.0 application to accept numbers and dates in pt-BR of the client side?

    
asked by anonymous 08.12.2017 / 17:27

0 answers