I have a pretty simple method I’m calling on Page load, it looks like this
Protected Sub identify()
If User.Identity.IsAuthenticated Then
Else
Response.Redirect("login.aspx")
End If
End Sub
What I want to do is throw a redirect depending on the role group the user is a part of. So if they are authenticated, but not part of the “Admins” user group, I’d redirect them to a different page….something like
Protected Sub identify()
If User.Identity.IsAuthenticated Then
If user.Identiy.IsInRoleGroup("Admin")
Response.Redirect("AdministratorDefault.aspx")
End If
Else
Response.Redirect("login.aspx")
End If
End Sub
Is something like this possible? I can’t find an answer.
If (User.IsInRole("Administrator"))...
End If
http://msdn.microsoft.com/en-us/library/system.security.principal.windowsprincipal.isinrole.aspx