Code:
@Html.TextBoxFor(x => x.PercentNos, new {@class = "percentage-numbers"})
How to set the numbers limit 0 to 100 in @html.textboxfor
in cshtml view page in mvc4?
You can use the Range attribute to limit the input from 0 to 100. You apply this attribute to the (target) property of the model you are using in your view.
[Range(0,100)]
public int PercentNos { get; set; }
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