I have a problem in my ASP.NET Core MVC application. I am trying to create input control that will be pass decimal parameter "Weight". Here's my .cshtml code:
<label asp-for="Input.Weight"></label>
<input asp-for="Input.Weight" type="number" step="any" min="20" class="form-control" />
<span asp-validation-for="Input.Weight" class="text-danger"></span>
and below is my cs code:
[Required]
[DataType(DataType.Currency)]
[Display(Name = "Waga [kg]")]
public decimal Weight { get; set; }
Every time when I try to put decimal value, it becomes zero (does not matter if I use comma or dot). When I write integer value, it works OK. I didn't find answer anywhere.