V
VB Programmer
I am using the Login control with ASP.NET 2.0.
I want the redirect page to go to a page BASED on the role the user is in.
Here's my code:
Protected Sub Login1_LoggedIn(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Login1.LoggedIn
If Roles.IsUserInRole("SiteAdministrator") = True Then
Response.Redirect("AdminsOnly/AdminHome.aspx")
Else
Response.Redirect("MembersOnly/MemberHome.aspx")
End If
End Sub
When I debug it and print this with a result of "True":
? Roles.IsUserInRole("SiteAdministrator") = True
I've also tried this with a result of "True":
? Roles.IsUserInRole(Me.Login1.UserName.ToString , "SiteAdministrator")
But, it KEEPS skipping to the Else part. Any ideas why? Any suggestions?
Thanks.
I want the redirect page to go to a page BASED on the role the user is in.
Here's my code:
Protected Sub Login1_LoggedIn(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Login1.LoggedIn
If Roles.IsUserInRole("SiteAdministrator") = True Then
Response.Redirect("AdminsOnly/AdminHome.aspx")
Else
Response.Redirect("MembersOnly/MemberHome.aspx")
End If
End Sub
When I debug it and print this with a result of "True":
? Roles.IsUserInRole("SiteAdministrator") = True
I've also tried this with a result of "True":
? Roles.IsUserInRole(Me.Login1.UserName.ToString , "SiteAdministrator")
But, it KEEPS skipping to the Else part. Any ideas why? Any suggestions?
Thanks.