問題描述
默認情況下,ASP.NET 登錄控件是否使用 ReturnURL 進行重定向? (By default, does ASP.NET Login Control use the ReturnURL to redirect?)
If I drop a System.Web.UI.WebControls.Login onto a page, should it redirect to the ReturnURL by default? Or do I have to set some config settings or write some code to make this work?
參考解法
方法 1:
Short answer: No.
If you do not specify a value for the DestinationPageUrl property, the user will be redirected to the original page the user requested after successfully logging in.
Full MSDN source
According to this blog post, it apparently also factors in whether the page with the login control is the LoginURL specified in web.config. It states:
If page is not defined as Login page in configuration file, ReturnUrl parameter is ignored completely.