I have a website, in which a user Logs in. I am using an asp:Login. The login page works fine, but i have associated an event handler that when the user logs in the site will get redirected to an authentication page which will send the Username in this manner.
protected void LoginUserPass_LoggingIn(object sender, LoginCancelEventArgs e)
{
Response.Redirect("~/Authenticate.aspx?user=" + LoginUserPass.UserName);
}
And the i have set the DestinationPageUrl of my LoginView to be "~/Authenticate.aspx". Once the user is authenticated another Redirection to a members page occurs. However in my Members page it does not show that the user is logged in.
<asp:LoginStatus ID="LoginStatus1" runat="server"
LogoutAction="Redirect" BackColor="White"
Font-Underline="True" LogoutPageUrl="~/Default.aspx" />
Where am i going wrong?
If the user is logging in with a username and password, then you redirect, your user is not logged in before the redirect on the
LogginInevent:Login.LoggingIn Event
Use LoggedIn instead:
Login.LoggedIn Event