By default, does ASP.NET Login Control use the ReturnURL to redirect?
-
12-09-2019 - |
Question
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?
Solution
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.
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow