Chrome浏览器的历史记录错误 - 做PRG,再次导航到相同的表单 - 没有添加历史记录 [英] Chrome history bug maybe - doing PRG, and when navigating again to the same form - no history entry is added

查看:205
本文介绍了Chrome浏览器的历史记录错误 - 做PRG,再次导航到相同的表单 - 没有添加历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

仅在Chrome中出现奇怪的后退按钮行为。

我有两个页面 - 网格和表单

场景:

1。当从网格导航到窗体时一切正常 - 网格添加到历史记录。

2.当窗体通过发布发送到服务器时,我使用RedirectToAction将(302)重定向到再次输入表格 - 将表格添加到历史记录中。

3.在重新定向后,再次从网格导航到表格时,包含网格地址的历史记录点是未添加到历史记录中



现在,您必须点击后退按钮上的两次才能返回网格。



如果您多次重复所有步骤并观察历史堆栈,您将看到一个表格条目的悲伤列表,而中间没有网格



编辑:这里是一个指向问题页面的链接,用chrome打开并按照说明操作 - 查看Chrome历史记录中的错误



我发现的唯一解决方案是将一些随机废话连接到表单,但我真的很讨厌这个。 使用 HTTP 303请参阅其他,而您的应用程序使用 302 Found 进行重定向。请在此处查看相关的Chrome问题报告: http://code.google.com / p / chromium / issues / detail?id = 2801 您可以投票修正ASP.Net MVC的RedirectToAction:


There is a strange back button behavior occurring only in Chrome.
I have two pages - Grid and a Form
the scenario:
1. When navigating from the Grid to the Form everything is fine - the Grid is added to the history.
2. When the Form is sent to the server via post, i use RedirectToAction to redirect(302) to the Grid again - the Form is added to the history.
3. When navigating again from the Grid to the Form after the redirect, a history point containing the Grid address is not added to the history

Now you have to click twice on the back button to get back to the grid.

if you repeat all the steps several times and watch the history stack you will see a sad list of Form entries without the Grid in the middle

edit: here is a link to a page demonstrating the problem, open it in chrome and follow the instructions - see the Chrome history bug in action

The only "Solution" i found for this is putting some random crap in the link to the Form, but i really hate this.

解决方案

Chrome is strict about using HTTP 303 See other while your application uses 302 Found for redirects. See a related chrome bug report here: http://code.google.com/p/chromium/issues/detail?id=2801

You can vote to fix ASP.Net MVC's RedirectToAction here: http://connect.microsoft.com/VisualStudio/feedback/details/706961/asp-net-mvc-controller-redirecttoaction-method-should-return-http-303-response

这篇关于Chrome浏览器的历史记录错误 - 做PRG,再次导航到相同的表单 - 没有添加历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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