I have a very similar problem to this post...
Webgrid not refreshing after delete MVC
Whatever I try, the WebGrid doesn't get updated/refreshed after inline editing/deletion although the viewModel contains the correct data before the View is shown...
Inside the Controller:
public ActionResult AddTermin(int? id, int? ser)
{
...
viewModel = ... //contains the correct (=updated) data
return View(viewModel); //contains the correct (=updated) data
}
Inside the View "AddTermin.cshtml":
@{
var data = new List<Appointment>();
if (Model != null && Model.RecurringAppointments != null)
{
data = Model.RecurringAppointments.Appointments; //contains the correct (=updated) data
}
var grid = new WebGrid(source: data, rowsPerPage: 10); //contains the correct (=updated) data
}
...
@grid.GetHtml(...) //shows wrong (=old/previous/cached) data - ???
I had added the following entry in web.config already...
<system.web>
<caching>
<outputCache enableOutputCache="false" />
</caching>
</system.web>
I also tried "[OutputCache(Duration = 0)]" already.
And I also tried "jQuery.ajaxSetup({ cache: false });".
And I also tried "ModelState.Clear();" already. But nothing works.
How can I get the WebGrid to show the updated data? Does someone have an idea?
Many thanks in advance!