如何从浏览器历史记录中删除网页? [英] How do I remove a page from the browser history?

查看:305
本文介绍了如何从浏览器历史记录中删除网页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个有一个包含一个按钮,一个ASP.Net页面。此页面包含一个服务器端的PayPal按钮。

I have an have an ASP.Net page which contains a button. This Page contains a ServerSide Paypal button.

当把我的服务器做后端的各种聪明的事情,然后重写响应作为一种形式,一些JavaScript哪些职位这种形式的贝宝..

When pushed my server does various clever things on the back end and then rewrites the response as a form and some javascript which posts this form to paypal..

这一切的伟大工程。

不过,如果用户随后选举单击后退,他们将到达我生成的自发帖的形式,这将再次转发给贝宝。

However, if the user then elects to click back, they will arrive at my generated self-posting form and that will forward them again to Paypal.

我想如果我能找到一种方法让我的生成表单页面史上不存在,那么这将解决我的问题。但我不知道如何纠正这一点。

I thought if I could find a way to have my generated form page not exist in the history, then this will solve my problem. but I have no idea how to correct this.

如何从历史记录中删除我的网页或者仅仅是它从来没有出现?

更新:感谢所有......那些都是一些伟大的答案。 Upvoted所有好的但splattne继续帐户巧妙利用隐藏字段,而不是饼干决策的依据。

Update: Thanks to all... Those are some great answers. Upvoted all good ones but went with splattne on account of clever use of hidden field rather than cookies for basis of decision.

推荐答案

我不知道是否可以做。但这里有一个想法,你怎么prevent了重新提交表单的。

I'm not sure if that can be done. But here is an idea how you could prevent that resubmit of the form.

您可以插入您的表单的隐藏输入这在开始时是空的。在提交你会在这一领域写入一个值,并确保你在每一个检查提交的尝试,如果该字段为空。

You could insert a hidden input in your form which at the beginning would be empty. On submit you'll write a value in that field and make sure you check on every submit attempt if this field is empty.

如果它不为空就提交你知道的形式是previously发送,你可以向用户发出警告。

If it is not empty on submit you know that the form was previously sent and you could warn the user.

这篇关于如何从浏览器历史记录中删除网页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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