[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 240
  • Last Modified:

user role validation for 2 user roles

I am trying to do a userrole validation where it checks if the if user is in eather of 2 roles and if they are, they pass if not it denies.
if (Roles.IsUserInRole(@"xxxx\xxxx" @"xxxx\xxxx"))
        {
 
	  }
 
else
        {
            Response.Redirect("http://xxxxxxx.aspx");
        }

Open in new window

0
Figle
Asked:
Figle
1 Solution
 
jandromedaCommented:
Your code should be changed like this.
if (Roles.IsUserInRole(@"xxxx\xxxx") || Roles.IsUserInRole(@"xxxx\xxxx"))
        {
 
          }
 
else
        {
            Response.Redirect("http://xxxxxxx.aspx");
        }

Open in new window

0
 
FigleAuthor Commented:
thanks for the help!
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now