Geeks With Blogs
Etienne Giust's .NET notes Some .NET tips and tricks for me to remember. That might help you too July 2012 Entries
Update the model on HttpPost and render the changes in the View
With MVC3, I came over that problem where I was rendering a view with an updated model at the end of an HttpPost and the changes to the model were never applied to the rendered view : NOT working as expected ! [HttpPost] public ActionResult Edit(JobModel editedJobModel) { // Update some model property editedJobModel.IsActive = true; // The view will NOT be updated as expected return View(editedJobModel); } This is the standard behavior. In MVC3, POSTing the model does not render the Html helpers ......

Posted On Wednesday, July 11, 2012 12:34 AM

Copyright © Etienne Giust | Powered by: GeeksWithBlogs.net