Internet Explorer Caching asp.netmvc ajax results

前端 未结 7 897
故里飘歌
故里飘歌 2020-12-16 13:09

I\'m having an issue with a page in internet explorer. I have an ajax call that calls a form, in other browser, when I click the link it passes in the controller and load co

7条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-16 13:35

    I also found this very useful on a similar (but not identical) issue.

    http://forums.asp.net/t/1681358.aspx/1?Disable+cache+in+Ajax+ActionLink+extension+method+in+asp+net+MVC

    Basically make sure that you're using POST as opposed to GET in your requests. Doing so seems to prevent IE from caching.

    Eg:

    @Ajax.ActionLink("Clear Contacts", MVC.Home.ClearContacts(), new AjaxOptions{HttpMethod = "POST", UpdateTargetId="targetDiv"})

提交回复
热议问题