I want the app to redirect a user to a different home page depending on their role. Its currently working for 2 users using the following IF?
If Request.IsAuthenticated AndAlso User.IsInRole("Staff") = True Then
Response.Redirect("~/About.aspx")
ElseIf Request.IsAuthenticated AndAlso User.IsInRole("HR") = False Then
Response.Redirect("~/HR\HRCompanyNavigation.aspx")
End If
How can I get this to work for more than 2 user roles?
Something like this? This might work for simpler scenarios. But you should have in mind that this is a weak construct if users has multiple roles.