我有一个问题。
这是一个简短的例子。这是模型。
public class MyModel
{
string Title{get;set;}
}
鉴于我写
@Html.TextBoxFor(model => model.Title)
这是控制器。
public ActionResult EditNews(int id)
{
var model = new MyModel;
MyModel.Title = "SomeTitle"
return View("News/Edit", model);
}
//for post
[HttpPost]
public ActionResult EditNews(MyModel model)
{
//There is problem.When I do postback and
// change Title in this place,Title doesn't change in view textbox
//Only when I reload page it change.
model.Title = "NEWTITLE"
return View("News/Edit", model);
}