Return a modified viewModel to view

I wanna do something like this:

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" />


I think this might be expected behavior because the "normal" scenario where you send back the same model to the view is when the model has errors.


Need Your Help

Skip UIImagePickerController Preview View?

iphone video uiimagepickercontroller movie

I'm using UIImagePickerController to allow my user to select a video from the asset library.

GCM java server example

android google-cloud-messaging

Does anyone have a link to GCM java 3rd Party Server example? I can't understand how to implement it. In, I could not find a complete example.