ページの読み込み時に呼び出す非常に単純なメソッドがあります。次のようになります。
Protected Sub identify()
If User.Identity.IsAuthenticated Then
Else
Response.Redirect("login.aspx")
End If
End Sub
私がやりたいのは、ユーザーが属しているロールグループに応じてリダイレクトをスローすることです。したがって、認証されているが「Admins」ユーザーグループの一部ではない場合は、別のページにリダイレクトします。
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
このようなことは可能ですか?答えが見つかりません。