0
我的模型有一個Dataype(Datatype.Currency),它是一個小數對象。MVC數據類型貨幣觸發器數字小鍵盤
我試圖強制視圖觸發ipad/iphone上的數字小鍵盤,當用戶點擊進入它。它適用於對象是INT但不適用於Decimal的情況。
繼承人的模型的片段(我使用正則表達式無濟於事試過):
[Display(Name = "Bid Price")]
[DataType(DataType.Currency)]
//[RegularExpression("([1-9][0-9]*)")]
public decimal BidPrice { get; set; }
這裏是視圖的片段。有沒有辦法以某種方式使用新的{@inputtype =「number」}?
<div class="col-md-10">
@Html.EditorFor(model => model.BidPrice, new { @type= "number" })
@Html.ValidationMessageFor(model => model.BidPrice)
</div>
請幫助,如果你有這個工作。
是的,這工作!我不知道我有多少網站試圖找到答案。謝謝!!! – dave317