Hi everyone,
I have implemented membership and enable role based on. I have 2 roles "admin" and "super_admin" and once the user login, I want to redirect them to different folder based on their role. My guess is, the redirection need to be determined once the user clicked login on the login control and here is my code. protected void LoginButton_Click(object sender, EventArgs e)
{
CheckUserRole();
}
private void CheckUserRole()
{
if (Context.User.Identity.IsAuthenticated && Roles.IsUserInRole("admin") == true)
{
Response.Redirect("~/Admin/Default.aspx");
}
else if (Context.User.Identity.IsAuthenticated && Roles.IsUserInRole("super_admin") == true)
{
Response.Redirect("~/Super_Admin/Default.aspx");
}
else
{
Response.Redirect(" ...
Go to the complete details ...