后退按钮不要求asp.net mvc的get方法 [英] Back button not requesting asp.net mvc get method

查看:115
本文介绍了后退按钮不要求asp.net mvc的get方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正面临着其中的后退按钮的点击,默认get方法是没有得到在asp.net的MVC引发的特定问题

We are facing a specific problem where in on click of backbutton, the default get method is not getting triggered in asp.net mvc

任何具体的解决办法?

推荐答案

如果浏览器的页面缓存,它会使用高速缓存中的人。

If the browser has the page cached, it'll use the one from cache.

试着告诉不要缓存响应。您可以用ActionFilter或全球在Global.asax中做到这一点。

Try telling the response not to cache. You can do it with an ActionFilter or globally in Global.asax.

    httpContext.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1));
    httpContext.Response.Cache.SetValidUntilExpires(false);
    httpContext.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
    httpContext.Response.Cache.SetCacheability(HttpCacheability.NoCache);
    httpContext.Response.Cache.SetNoStore();

在这里更多选项:

More options here:

asp.net的MVC禁用浏览器的缓存

这篇关于后退按钮不要求asp.net mvc的get方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆