看起来我不能同时担任这两个角色。如果我只使用"管理员"它的作品,如果只是"顾问"它也可以工作,但当我编码他们所有任何想法或帮助时不能工作?我需要两个角色
这是我的代码
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
' Check that the user is a registered user
If User.Identity.IsAuthenticated = False Then
Response.Redirect("Unauthorized.aspx")
End If
' Check that the user belongs to the role Administrators
If Roles.IsUserInRole("administrator") = False Then
Response.Redirect("Unauthorized.aspx")
End If
' Check that the user belongs to the role Advisor
'If Roles.IsUserInRole("advisor") = False Then
' Response.Redirect("Unauthorized.aspx")
'End If
End Sub