Hi, i want to redirect the user after the log in based on his role. e.g. admin, user
I already read the other threads..
I already used this:
Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs)
If Membership.ValidateUser(Login1.UserName, Login1.Password) Then
e.Authenticated = True
If Roles.IsUserInRole("Administrator") Then
Login1.DestinationPageUrl = "~/OpticsCategories.aspx"
ElseIf Roles.IsUserInRole("User") Then
Login1.DestinationPageUrl = "~/Admin/AdminLoggedIn.aspx"
End If
Else
e.Authenticated = False
End If
End Sub
And this:
Protected Sub Login1_LoggedIn(sender As Object, e As EventArgs)
' if there is no returnUrl in the query string , we redirect based on user role
If String.IsNullOrEmpty(Request.Quer ...
Go to the complete details ...