Web.Security.Membership and Web.Security.Roles
I am currently using Web.Security.Membership and Web.Security.Roles. For some reason Membership always produces the expected results but Roles seems to be a probl开发者_JAVA技巧em. When debugging the following code the result is different for roleExists1 and roleExists2.
bool roleExists1 = Roles.RoleExists("Administrator");
bool valid = Membership.ValidateUser(emailAddress, password);
bool roleExists2 = Roles.RoleExists("Administrator");
Can anyone suggest why roleExists1 is 'true' and roleExists2 is 'false'?
精彩评论