What am I misunderstanding about how Html.TextBoxFor works

前端 未结 3 1501
旧时难觅i
旧时难觅i 2021-01-05 03:02

I\'m just trying to get back into .NET MVC with the new release and I can\'t get my head round the way may view is binding to the DataModel.

I have a model with a pr

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-05 03:46

    This should work for the first two:

    <%= Html.TextBox("first_name", x => x.first_name)%>
    <%= Html.TextBoxFor(model => model.first_name) %> 
    

提交回复
热议问题