MVC Datatype Currency trigger numeric keypad

The EditorFor() method does not support adding htmlAttributes unless your using MVC-5.1 or higher. If you are the the syntax is

@Html.EditorFor(m => m.BidPrice, new { htmlAttributes = new { @type= "number" } })

If your not, then you will need to use the TextBoxFor() method to add the attribute

@Html.TextBoxFor(m => m.BidPrice, new { @type= "number" })

Leave a Comment