I have a JQuery Ajax call that posts some data (Json) to a MVC Controller. Basically in my method I have
public JsonResult Save()
{
TryUpdateModel(MyModel)
...
}
What I want to do is change some values in the posted Ajax data, before calling TryUpdateModel(). I've tried numerous ways including
ViewData.ModelState.SetModelValue("MyTextBox", new ValueProviderResult("Some string", string.Empty, new System.Globalization.CultureInfo("en-US")));
Everything time it appears that the values I'm changing aren't being updated. Any ideas where I'm going wrong ?