检测页面刷新并防止其重定向到错误页面

检测页面刷新并防止其重定向到错误页面

本文介绍了检测页面刷新并防止其重定向到错误页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好专家,

我正在开发c#asp.net网页.
我必须禁止在其他标签页或其他浏览器窗口中重新打开该网站.
我能够处理生成唯一的PageId.当用户在另一个标签或新的浏览器窗口中打开相同的网站时,将生成一个新的页面ID,
我对照当前页面ID对其进行了检查,并将其重定向到错误页面.
但是,当我刷新页面时,我也得到了新的PageId,而不是现有的,因此它被重定向到错误页面.
我在互联网上搜索了解决方案,但这些解决方案都不对我有用.如何检测刷新?
你能指导我如何处理吗?

谢谢
RaesaRk

Hello experts,

I am working on c# asp.net web page development.
I have to disallow the site from reopening in other tabs or other browser windows.
That I am able to handle generating unique PageId. When the user opens the same site in another tab or new browser window, a new page id is generated,
I check it against the current page id and redirect it to the error page.
But when I refresh the page, I also get the new PageId and not the existing one and so it gets redirected to the error page.
I searched on internet for solutions but none of those solutions are working for me. How can I detect a refresh??
Can you please guide me on how to handle this??

Thanks
RaesaRk

推荐答案


这篇关于检测页面刷新并防止其重定向到错误页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 04:12