即使URL被选中,F5键也不起作用。 [英] F5 key should not work even the URL is Selected.

查看:80
本文介绍了即使URL被选中,F5键也不起作用。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

F5键不起作用。



即使选择了URL,F5键也不起作用...



页面在提交数据后不应刷新...



因为如果已将数据插入数据库并且我们再按f5数据插入数据库..所以f5不应该工作..



请任何人帮助我....

F5 key should not work.

F5 key should not work even after URL has been selected...

page should not get refreshed after submitting the data...

because if data has been inserted in to database and if we press f5 again the data is inserting in to database.. so f5 should not work..

Please any one help me....

推荐答案

由于不同浏览器的关键代码实现,我不确定这个解决方案是否适用于所有浏览器。



请参考此 [ LINK ]和有关的信息检测 [键码]用于解决您的问题。
I am not sure solution for this will work across all browsers because of key code implementation of different browsers.

Please refer to this [LINK] and information on detecting [keycodes] for the solution of your problem.


注意:如果你想提交数据并留在页面上,你将不得不使用类似AJAX的方法发送数据(而不是ASP.NET提供的内置回发)





在客户端浏览器上,为了在Javascript中禁用/启用F5(使用jQuery):

NOTE: If you want to submit the data and to stay on the page, you will have to send the data using AJAX like methodology (instead of the built in Postback that ASP.NET provides)


On the client side browser, in order to disable/enable F5 in Javascript (using jQuery):
function disableF5(e) { if ((e.which || e.keyCode) == 116) e.preventDefault(); };
// To disable f5


(< span class =code-sdkkeyword> document )。bind( keydown, disableF5);
OR
(document).bind("keydown", disableF5); OR


这篇关于即使URL被选中,F5键也不起作用。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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