ASP.NET MVC 4 currency field

后端 未结 3 1130
迷失自我
迷失自我 2021-02-14 21:23

I get an error (\"The field Amount must be a number\") on my web page on a currency field. It is because of the dollar sign ($50.00).

[DataType(DataType.Currency         


        
3条回答
  •  青春惊慌失措
    2021-02-14 21:55

    You can also set edit mode to false. Then it will only show the decimal value while text will be formatted.

    ApplyFormatInEditMode = false
    

提交回复
热议问题