asp core razor weird behavior

#336
Raw
Author
Anonymous
Created
March 2, 2021, 1:47 a.m.
Expires
Never
Size
508 bytes
Hits
30
Syntax
None
class MyModel
{
   /// type is String , not Int
   public string Amount {get; set;}
}

in a razor core cshtml file

// you can save (httpPost) the form and value will be saved in db
//
// but on page Get, the value of input will remains 0 ... even if the Amount contains an actual number
<input type="number" min="0" max="100" value="0" asp-for="Model.Amount" />

// doing this werks
<input type="number" min="0" max="100" value="Model.Amount" asp-for="Model.Amount" />


why ???