将用户重定向到他登录的页面 [英] redirect user to same page where he login

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

问题描述

嗨!
我希望用户重定向到他输入登录信息的页面.
或例如
我在主页上具有登录控制,现在,例如,用户正在导航某个页面,例如commnent.aspx,他需要登录某些任务.如果用户按下登录名,他将被重定向到登录页面.现在登录后,我想要自动重定向到他以前喜欢comment.aspx的同一页面...我希望每个页面都使用此..我如何才能实现此

hi!
i want the user to redirect to the same page where he entered login info.
or e.g
i have login control on the master page and now for e.g user is navigating some page and for e.g commnent.aspx for some task he need to login .if the user presses login he is redirected to the login page..now after the login i want to automatically redirect to the same page where he was previously like comment.aspx...i want this for every page ..how i could acheive this

推荐答案

一个各种方式:
1.在comment.aspx中,用户按下登录键,将当前URL保存在一个会话中(将其命名为browserdURLSession),然后重定向到登录页面.
2.用户登录后,将usser配置文件保存在会话中或维护登录的会话,以便您可以标识该用户已登录.
3.检查浏览的URL会话值(browsedURLSession),如果为null,则显示主页.如果其中包含一些网址,请重定向到该网址.

尝试!
One of various ways:
1. When from comment.aspx, user presses login, save the current URL in a session (call it browsedURLSession) and then redirect to login page.
2. Once the user logs in, save the usser profile in session or maintain the logged in session such that you can identify that user is logged in.
3. Check for browsed URL session value (browsedURLSession), if it''s null show the home page. If it holds some url, redirect to that one.

Try!


请参阅此代码项目的问答. 在C#.net中进行网址重写 [
Please see this code project Q/A. Url rewriting in C#.net[^]


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

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