MVC后退按钮问题 [英] MVC Back button issue

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

问题描述

我的操作方法,我需要单击后退按钮时执行。我已经在我的操作方法禁用缓存(Response.Cache.SetCacheability(HttpCacheability.NoCache),这是不工作的不同操作方法之前做到了这一点。出于某种原因,当我禁用缓存,并点击后退按钮触发页面失效我的操作方法。什么问题可能是任何想法?

I have an action method that I need to execute when the back button is clicked. I've done this before by disabling the cache in my action method (Response.Cache.SetCacheability(HttpCacheability.NoCache). This isn't working for a different action method. For some reason when i disable the cache and hit the back button to trigger my action method the page expires. Any ideas on what the issue may be?

推荐答案

有没有办法知道,在服务器端,如果页面请求是返回按钮的结果还是不行。

There is no way to know, on the server side, if the page request was the result of the back button or not.

更可能的,在previous请求是一个职位,而不是一个GET,和后需要您重新发布的数据。

More than likely, the previous request was a post rather than a get, and the post requires that you repost the data.

这篇关于MVC后退按钮问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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