1
我有一個MVC4應用,類型的屬性中的一個是decimal
,當它加載視圖它增加了一個零到文本框。小數類型屬性增加了一個零到文本框
如何使文本框在第一次加載時爲空?
[DataType(DataType.Currency)]
[Column(TypeName = "money")]
[Display(Name ="Amount")]
[Required(ErrorMessage = "You must add amount")]
public decimal Amount { get; set; }
@Html.TextBoxFor(model => model.Amount, new { @class = "form-control" })
感謝。