hi
I was just fidling with Accouns code.I created a Login page using the approach shown in the page. the code for the logi button is as:
Code:
private void Login_btn_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
PhilePrincipal newUser = PhilePrincipal.ValidateLoginExample( UsernameBox.Text, PasswordBox.Text );
if (newUser == null)
{
Label1.Text="problem";
}
else
{
Context.User = newUser;
FormsAuthentication.SetAuthCookie( UsernameBox.Text, true );
//Label1.Text="worked " + Context.User.Identity.Name;
Response.Redirect("../../modules/products/loginexamplesuccess.aspx");
}
}
The problem I am facing is this:
If I display '...Identity.Name' in the current page (the login page), then the correct identity name is displayed. However, if I redirect the user to another page (as shown above) and check ( Context.User.Identity.IsAuthenticated ) then I get the user not to be authenticated.
Is there a different way I have to use Response.Redirect???
I have commented out:
// permissionList = dataUser.GetEffectivePermissionList( ((Business.SiteIdentity)identity).UserID );
// roleList = dataUser.GetUserRoles( ((Business.SiteIdentity)identity).UserID );
in the PhilePrincipal. That should not make a difference, should it??
thanks