Check if User is in Role

/ Published in: C#
Save to your folder(s)

Copy this code and paste it in your HTML
  1. string SomeUser = Page.User.Identity.Name;
  3. if (Roles.IsUserInRole(SomeUser, "host"))
  4. {
  5. // if user is in role "host"
  6. }

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.