The problem: How to update ModelState in posting+validation scenario.
I\'ve got a simple form:
<%= Html.ValidationSummary() %>
<% using(Html
I know this post is fairly old but it's a problem I've had before and I just thought of a simple solution that I like - just clear the ModelState after you've got the posted values.
UpdateModel(viewModel);
ModelState.Clear();
viewModel.SomeProperty = "a new value";
return View(viewModel);
and the view has to use the (possibly modified) view model object rather than the ModelState.
Maybe this is really obvious. It seems so in hindsight!