I have the known problem on decimal data types and the error "The field fieldname must be a number." I'm developing a ASP.NET Web App in .NET Core 2.2 with c#.
The model extract is the following:
public DateTime? ValidTo { get; set; }
public decimal? TimeZone { get; set; }
public int? Idwfstate { get; set; }
and the cshtml extract is as follows:
<div class="form-group">
<label asp-for="item.TimeZone" class="control-label"></label>
<input asp-for="item.TimeZone" class="form-control" />
<span asp-validation-for="item.TimeZone" class="text-danger"></span>
</div>
After enabling globalization for jquery validation plugin and putting the following code in startup.cs :
var defaultCulture = new CultureInfo("us-UK");
var localizationOptions = new RequestLocalizationOptions
{
DefaultRequestCulture = new RequestCulture(defaultCulture),
SupportedCultures = new List<CultureInfo> { defaultCulture },
SupportedUICultures = new List<CultureInfo> { defaultCulture }
};
app.UseRequestLocalization(localizationOptions);
the problem persist.
Any suggestions? Thanks.