rrhandle8
asked on
How to find user role with IdentityHelper, then redirect
How do I find the role the user belongs to then redirect to a page in the Admin folder if they belong to the Admin role.
Protected Sub LogIn(sender As Object, e As EventArgs)
If IsValid Then
' Validate the user password
Dim manager = New UserManager()
Dim user As ApplicationUser = manager.Find(UserName.Text, Password.Text)
If user IsNot Nothing Then
IdentityHelper.SignIn(manager, user, RememberMe.Checked)
IdentityHelper.RedirectToReturnUrl(Request.QueryString("ReturnUrl"), Response)
End If
Else
FailureText.Text = "Invalid username or password."
ErrorMessage.Visible = True
End If
End If
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://forums.asp.net/t/2009956.aspx?Log+in+form+couple+of+questions