I wanna do something like this:
[HttpPost]
public ActionResult Index(Foo foo)
{
foo.Name = "modified";
return View(foo);
}
but when my view is rendered, it always has the old values! How can I modify and return? Must I clear the ModelState everytime?
My view:
@model MvcApplication1.Models.Foo
@using (Html.BeginForm())
{
@Html.TextBoxFor(m => m.Name)
@Html.TextBoxFor(m => m.Description)
<input type="submit" value="Send" />
}