Default value for TextBoxFor in ASP.NET MVC

前端 未结 6 1685
我寻月下人不归
我寻月下人不归 2021-01-13 09:04

In ASP.NET MVC, I wrote below code to give the textbox a initial value:

@Html.TextBoxFor(p => p.WEIGHT, new { tabindex = \"140\", 
                                


        
6条回答
  •  一整个雨季
    2021-01-13 09:44

    Well you've explicitly stated Value, not value.

    Try:

     @Html.TextBoxFor(p => p.WEIGHT, new { tabindex = "140", @class = "mustInputText noime  w50", maxlength = "8", @value = "0", rule = "InputOnlyNum" })
    

提交回复
热议问题