In model class column name is public int? CTScore { get; set; }
and in Razor view I want to use this as @Html.EditorFor(model => model.CTScore)
.
It is showing as editor box along with Up/Down arrow spin buttons, but I need not show those spin buttons. How to do?
Any help is appreciated.
It sounds like Razor is adding type="number"
to your input
field, which causes modern browsers to show the spin buttons. If you want to disable this, and use type="text"
instead, you can add a DataType
attribute to your property:
[DataType(DataType.Text)]
public int? CTScore { get; set; }
The following line is what you need.
@Html.EditorFor(model => model.CTScore, new { htmlAttributes = new { @type="text" } })
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With