如何保持从重写我的ASP.NET登录控件的属性DestinationPageUrl我的Login.aspx页的RETURNURL参数? [英] How do I keep my Login.aspx page's ReturnUrl parameter from overriding my ASP.NET Login control's DestinationPageUrl property?
问题描述
我使用的是 ASP.NET登录控件并的表单验证为ASP.NET Web应用程序的会员/凭据。我得如的 PasswordRecovery.aspx 的是accessable只能匿名用户的页面。当我点击从这样的页面我的登录链接,登录页面有一个 RETURNURL 的在地址栏中参数:
I'm using the ASP.NET Login Controls and Forms Authentication for membership/credentials for an ASP.NET web application. I've got pages such as PasswordRecovery.aspx that are accessable to only Anonymous users. When I click my login link from such a page, the login page has a ReturnUrl parameter in the address bar:
<一个href=\"http://www.example.com/Login.aspx?ReturnUrl=PasswordRecovery.aspx\">http://www.example.com/Login.aspx?ReturnUrl=PasswordRecovery.aspx
和则成功登录后,用户将返回到的 PasswordRecovery.aspx 的规定页的 RETURNURL 的参数,它们不再具有访问权限。
And then after a successful login, users are returned to the PasswordRecovery.aspx page specified in the ReturnUrl parameter to which they no longer have access.
推荐答案
我发现的速度点评的。我处理的事件的loggedIn强制重定向到DestinationPageUrl页面。
I found the answer on Velocity Reviews. I handled the LoggedIn event to force a redirection to the DestinationPageUrl page.
Public Partial Class Login
Inherits System.Web.UI.Page
Protected Sub Login1_LoggedIn(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Login1.LoggedIn
'overrides ReturnUrl page parameter
Response.Redirect(Login1.DestinationPageUrl)
End Sub
End Class
这篇关于如何保持从重写我的ASP.NET登录控件的属性DestinationPageUrl我的Login.aspx页的RETURNURL参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!