Default value for TextBoxFor in ASP.NET MVC

前端 未结 6 1688
我寻月下人不归
我寻月下人不归 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:46

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

提交回复
热议问题