1

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

Dr. Paul Jarvis
  • 256
  • 3
  • 15
  • 2
    too few info, only reason in given context could be that Membership.ValidateUser creates the role – Robert Mar 18 '11 at 18:22
  • what is your membership and role provider? According to MSDN, Roles checks the underlying role data source. So the expected reason for the failure is a change in that data source. – yamspog Apr 13 '11 at 22:39

0 Answers0