登录后如何在登录之前将用户重定向到他们请求查看的页面. [英] How to redirect user to page they requested to view before logging in after they have logged in.

查看:156
本文介绍了登录后如何在登录之前将用户重定向到他们请求查看的页面.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在用户输入URL的请求页面上重定向用户.如果没有抢劫该用户,则该用户将首先请求登录,然后将其重定向到相同的链接...任何软件都可以帮助我..吗?在此先感谢...

I want to redirect the user on the requested page which user enters in url. If the user is not looged in then first it user will requested to log in and then after it''ll redirect to the same link... Can any onw help me out..? thanks in advance...

推荐答案

1.在会话中保存当前页面地址.
2.重新将用户重新登录到登录页面.
3.登录后,将用户重定向到会话中保存的地址.

获取URL:
1. Save the current page address in a session.
2. Redurect user to Login page.
3. after loging in, redirect the user to the address that has saved in the session.

To Get URL:
string url = HttpContext.Current.Request.Url.AbsoluteUri; 



或看看这个:
http://www.powerasp.net/content/new/get-current-page- url.asp [^ ]



Or Look at this:
http://www.powerasp.net/content/new/get-current-page-url.asp[^]


这篇关于登录后如何在登录之前将用户重定向到他们请求查看的页面.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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