I have a simple login control on the Login.aspx page in my site. On the master page I have a LoginStatus control. When the users pick login it takes them to my login page but includes the returnurl parameters. When the user logs in I have the DestinationPageUrl
set to send them to the page I want them to see. Instead the user is sent back the whatever page they were on, via the returnurl parameters. Is there a way to always force the login control to follow the DestinationPageURL setting verus the returnURL parameter
string?
keeperofstar...
Member
377 Points
264 Posts
Login Control DestinationPageUrl not working
Oct 21, 2008 07:02 PM|LINK
I have a simple login control on the Login.aspx page in my site. On the master page I have a LoginStatus control. When the users pick login it takes them to my login page but includes the returnurl parameters. When the user logs in I have the DestinationPageUrl set to send them to the page I want them to see. Instead the user is sent back the whatever page they were on, via the returnurl parameters. Is there a way to always force the login control to follow the DestinationPageURL setting verus the returnURL parameter string?
Thanks
MikaelKP
Member
286 Points
47 Posts
Re: Login Control DestinationPageUrl not working
Oct 21, 2008 07:22 PM|LINK
Hi,
Add this in web.config-file:
<authentication mode="Forms"><
forms loginUrl="~/Authentication/Login.aspx" timeout="15" slidingExpiration="true" /></
authentication>loginURL is the file path of where you have your Login.aspx file
timeout indicates how long time a logged in user can be inactive - the paremeter is in min.slidingExpiration resets the timeout every time a page loads - change the value to false and the user will be logged out after e.g. 15 min.
Compare with your Login.module:
<asp:Login ID="Login1" runat="server" FailureText="Dine brugeroplysninger blev ikke genkendt - pr›v igen." LoginButtonText="Login" PasswordRecoveryText="Glemt password?" PasswordRecoveryUrl="~/Membership/ForgotPassword.aspx" PasswordRequiredErrorMessage="Password skal udfyldes." RememberMeText="Automatisk login" TitleText="" UserNameLabelText="Brugernavn:" UserNameRequiredErrorMessage="Brugernavn skal udfyldes." Width="155px" DestinationPageUrl="~/Portal/Default.aspx"> <TextBoxStyle Width="95px" Height="12px" /> <LoginButtonStyle Height="19px" /> </asp:Login>Your application should redirect you correct now..
Best regards
Mikael
Mikael Kjær Petersen, Denmark (Europe)
I love security in ASP.NET :)
__________________________________________________
Please mark 'As Answer' if my suggestion helped you..
keeperofstar...
Member
377 Points
264 Posts
Re: Login Control DestinationPageUrl not working
Oct 22, 2008 01:10 PM|LINK
See that is the weird thing the DestinationPageUrl is not being followed as it should, instead the returnURL Parameters are overwritting.
Trying to figure out how to stop the returnURL Parameters from overwritting.
anas
All-Star
73649 Points
7914 Posts
Moderator
Re: Login Control DestinationPageUrl not working
Oct 22, 2008 01:27 PM|LINK
Handles the Login cotnrol logged in event ,
protected void Login1_LoggedIn(object sender, EventArgs e) { Response.Redirect("MyPage.aspx"); }