UPDATE: Jacco's suggestion (below) fixed this for me. I.e., ModelState.Clear() is your friend.
I have a controller called ScheduleController with an ActionResult that looks like this:
[HttpPost]
public ActionResult Create(ScheduledCall scheduledcall)
The scheduledCall model object has a property called content. I have a condition in which I would like to alter the value of the content property and return the model to the view for the user to read in the browser. I'm finding that while changing the value of the property is easily done, the view doesn't render the new value to the HTML display. Instead, it shows the content the user submitted.
Example in the controller action:
scheduledcall.Content = "Mark my words!";
ViewBag.message = scheduledcall.Content;
return View(scheduledcall);
On the view, I output @ViewBag.message (which was set in the controller to match the value of the scheduledcall.Content property). The output in the view is "Mark my words!", but the text area for content (@Html.TextAreaFor(model => model.Content)) shows the text the user input, not "Mark my words!".
How do I get the view to display the updated value in the text area?