通过仅在地址栏中写入其网址来限制用户直接进入该页面. [英] restrict user to directly go to a page by just writing its url in address bar.

查看:120
本文介绍了通过仅在地址栏中写入其网址来限制用户直接进入该页面.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我如何通过仅在地址栏中键入页面url来限制用户进入结果页面.
我希望用户首先进入考试页面,然后他将被重定向到结果页面,但是如果他只是键入结果页面的url,他将被重定向到结果页面,我不想发生这种情况. ="h2_lin">解决方案

尝试使用

Request.UrlReferrer



如果该值为空,则表示用户正在通过在地址栏中键入url来请求页面.

您的情况应该是考试页面.

希望这会有所帮助.


hello,
how can i restrict user to go into results page by just typing pages url in addressbar .
i want user to go first to exam page, then he will be redirected to results page, but if he just types the url of results page, he is redirected to result page, which i don''t want to happen.

解决方案

Try using

Request.UrlReferrer



If this value is empty it means that user is requesting the page by typing the url in address bar.

It should be exam page in your case.

Hope this helps.


这篇关于通过仅在地址栏中写入其网址来限制用户直接进入该页面.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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