登录控制和ReturnUrl [英] Login Control and ReturnUrl

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

问题描述

您好,


我有一个需要设置登录验证的数据库界面。为此我有一个登录视图,其中我有登录控件,我已经通过使用成员资格类和角色完成了身份验证。但我遇到的问题是回归。我想要做的是如果会话到期我想让用户在他登录后被定向回用户所在的页面。我确信returnurl是解决方案,但它对我不起作用。我相信我正在做一些事情。我甚至没有传入任何形式的查询字符串。这是我在Login.aspx.cs中的代码
页面加载事件中的



Hello,

I have a database interface that needs to have a login authentication set up. SO for this I have a login view inside which i have the login control and i have accomplished the authentication by using membership class and role. But what i am having issue is with the returnurl. What i am trying to do is if the session expires i want the user to be directed back to the page that the user was on after he logs in. I am sure returnurl is the solution but it doesnt work for me. I am sure i am doing some thing worng. I dont even get any form of query string being passed in. Here is the code that i have in Login.aspx.cs
in the page load event.


展开 | 选择 | Wrap | 行号

推荐答案

Request.Query中是否包含任何内容?尝试使用Request.Parem []代替?
Does Request.Query ever have anything in it? Try using Request.Parem[] instead?



如果你想让他们回到当会话超时时他们所在的页面?


当您单击浏览器中名为Referer的链接时会有一个标题传递,其中包含的URL他们来自哪个页面。
Why bother having a login section at all if you want them to go right back to the page they were on when the session times out?

There is a header that gets passed when you click a link in the browser called like Referer or something, that would contain the URL of the page they came from.



我在回答问题时编辑了解释。请重新阅读并提供帮助。


谢谢

I editted the explanation while you replied to my problem. Please re-read and help.

Thank you


任何正文可以帮助解决这个问题吗?
Can any body help with this issue?


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

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