本文介绍了Asp.net页面禁用了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在在asp.net中有一个页面,我希望一旦用户进入此页面。他不应该回去,即前一页,禁用浏览器的后退按钮以及所有移回的可能性。

I am having a page in asp.net now i want once user entered this page . he should not move back i.e previous page anyway, disable back button of browser and such all possiblities for moving back.

推荐答案

<head runat="server">

<title>Untitled Page</title>

<script type = "text/javascript" >

function preventBack(){window.history.forward();}

setTimeout("preventBack()", 0);

window.onunload=function(){null};

</script>

</head>

<body>

<form id="form1" runat="server">

<div>

<h1>Hi this is a test page</h1>

<a href ="index.html">Diable Back Button</a>

</div>

</form>

</body>

</html>







[]




这篇关于Asp.net页面禁用了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 19:06
查看更多