重定向到登录页面 [英] To redirect to login page

查看:102
本文介绍了重定向到登录页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在开发一个应用程序,如果我复制&粘贴其他页面的网址,我应该将其重定向到登录页面该怎么做

Hi
I am developing an application in that if i copy & paste the url of my other pages i should redirect it to the login page how to do it

推荐答案


试试这个
http://msdn.microsoft.com/en-us/library/ie/xdt4thhy.aspx [^ ]

http://msdn.microsoft.com/en-us/library/system.web.security.formsauthentication.signout.aspx [ ^ ]

http://stackoverflow.com/Questions/4834387/how-to-redirect-users-to-an-asp-net-page-when-未经授权 [ ^ ]
Hi ,
try this
http://msdn.microsoft.com/en-us/library/ie/xdt4thhy.aspx[^]

http://msdn.microsoft.com/en-us/library/system.web.security.formsauthentication.signout.aspx[^]

http://stackoverflow.com/questions/4834387/how-to-redirect-users-to-an-asp-net-page-when-not-authorized[^]


使用查询字符串检查下一页是否具有该查询字符串.
如果它们是查询字符串,则按照您的意愿定向页面.

但是,如果您直接键入页面的URL,则不会获得查询字符串,因此可以将其重定向到登录页面.


希望对您有所帮助.
随时问任何问题.
use query string to check whether the coming page is having that query string.
If thier is a query string then the page is directed as your wish.

But if you directly type the url of the page you will not get query string in and hence you can redirect him to login page.


Hope it will help.
Feel free to ask any question.





您还可以检查会话变量,以便将带有登录名的会话变量放在每个页面上并进行检查.这也会解决会话过期的问题

步骤1:添加Session.add("LoginName")= txtUsername.text
(在登录页面上)

第2步:检查会话是否在每个页面的logi名称中具有值
如果不支持,请重定向到登录页面
(在每一页上)

如果不适合您,请随时提出其他问题.
Hi


you can also check the session variable for that put a session variable with login name and check it on every page.it will solve the problem for session expiry also

step 1 : add Session.add("LoginName") = txtUsername.text
( On the login page)

step 2 : Check if session has the value in logi name on each page
if not fount redirect to the login page
( On each page)

Feel free for further question if not working for you..


这篇关于重定向到登录页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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