ASP.NET MVC 3 Ajax.BeginForm and Html.TextBoxFor does not reflect changes done on the server

前端 未结 2 1000
情书的邮戳
情书的邮戳 2021-01-01 03:05

I\'m using the Ajax.BeginForm helper in ASP.NET MVC3 to submit a form that replaces itself with new values in the form set on the server. However when I use helpers like Htm

2条回答
  •  甜味超标
    2021-01-01 03:54

    you can use

    ModelState.Clear() 
    

    in your controller method to make the html helpers use your changed model. Otherwise they use the values from the form submit

    Have a look at: Asp.net MVC ModelState.Clear

提交回复
热议问题