asp.net-mvc – Html.TextBoxFor在POST操作中不显示更新的值

在我看来,我有
<%:Html.LabelFor(model => model.IPAddress)%>

    <div class="editor-field">
        <%:Html.TextBoxFor(model => model.IPAddress)%>
        <%:Html.ValidationMessageFor(model => model.IPAddress)%>
    </div>

在我的控制器(post方法)中,我有这个

[HttpPost]
public ActionResult Manipulation(MyModel model){
  //I change modele here
  if(somthing)
    model.IPAddress="100.100.100.100";
  return View(model);
}

所以,我的问题是:
当我更改模型时,TextBoxFor不会更改其值.
当我从get方法到帖子时,TextBoxFor得到他的值,后来我无法改变TextBoxFor的值.
我调试,我的模型有新值,但TextBoxFor没有显示新值.

你能帮助我吗?

解决方法

尝试:
ModelState.Clear();
return View(model);

如果不是结果!返回JSON结果,然后通过javascript更新

相关文章

### 创建一个gRPC服务项目(grpc服务端)和一个 webapi项目(...
一、SiganlR 使用的协议类型 1.websocket即时通讯协议 2.Ser...
.Net 6 WebApi 项目 在Linux系统上 打包成Docker镜像,发布为...
一、 PD简介PowerDesigner 是一个集所有现代建模技术于一身的...
一、存储过程 存储过程就像数据库中运行的方法(函数) 优点:...
一、Ueditor的下载 1、百度编辑器下载地址:http://ueditor....