, , HTML- ModelState . , POST, , . :
[HttpPost]
public ActionResult Index(MyViewModel model)
{
ModelState.Remove("SomePropertyThatYouWantToModify");
model.SomePropertyThatYouWantToModify = "some new value";
return View(model);
}
@Html.HiddenFor(x => x.SomePropertyThatYouWantToModify) .
, ViewData ( , ):
[HttpPost]
public ActionResult Index(FormCollection form)
{
ModelState.Remove("SomePropertyThatYouWantToModify");
ViewData["SomePropertyThatYouWantToModify"] = "some new value";
return View();
}
@Html.Hidden("SomePropertyThatYouWantToModify") .