What am I misunderstanding about how Html.TextBoxFor works

前端 未结 3 1536
旧时难觅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

    Because HTML helpers read the value from the ModelState and not from the model. In order the change that behavior you'll need to work with the ModelState as well.
    (see: Changing model’s properties on postback)

提交回复
热议问题