MVC 3 - Html.EditorFor seems to cache old values after $.ajax call

前端 未结 5 1855
一整个雨季
一整个雨季 2020-11-27 14:09

This is a follow on from the following question:

MVC 3 + $.ajax - response seems to be caching output from partial view

There is a detailed description of th

5条回答
  •  广开言路
    2020-11-27 14:47

    Even if you do not specify caching, it sometimes can occur. For my controllers which handle AJAX and JSON requests, I decorate them as follows:

    [OutputCache(Location = OutputCacheLocation.None, NoStore = true)]
    

    This specifically declares no caching should occur.

    UPDATE

    Based on an answer Darin Dimitrov gave here, try adding the following line to your controller action:

    ModelState.Clear();
    

提交回复
热议问题