I want to do something like this:
[HttpPost]
public ActionResult Index(Foo foo)
{
foo.Name = "modified";
return View(foo);
}
but when my view is displayed, it always has the old meanings! How can I change and return? Do I have to clear ModelState every time?
My opinion:
@model MvcApplication1.Models.Foo
@using (Html.BeginForm())
{
@Html.TextBoxFor(m => m.Name)
@Html.TextBoxFor(m => m.Description)
<input type="submit" value="Send" />
}
source
share