开发者

Web.Security.Membership and Web.Security.Roles

开发者 https://www.devze.com 2023-02-17 13:32 出处:网络
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

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'?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号