Html.TextBoxFor does not show updated value in POST action

前端 未结 4 2169
不思量自难忘°
不思量自难忘° 2021-02-13 21:12

In my view I have

      <%:Html.LabelFor(model => model.IPAddress)%>

    
<%:Html.TextBoxFor(model => m
4条回答
  •  旧时难觅i
    2021-02-13 21:38

    Here's another work around that I found. Instead of

    @Html.TextBoxFor(m=>m.PropertyName)
    

    do this

    @{
    var myModel = Model;
    }
    @Html.TextBoxFor(m=>myModel.PropertyName)
    

    This could be useful if you don't want to override the default behavior for every input.

提交回复
热议问题