Greetings All,
I have been triying to impliment a new role provider and i'm experiencing
weird behavior. I have tried custom code (as well as code samples from
microsoft) and have experienced similiar results.
here is a like to the code that I used directly from microsoft.
http://msdn2.microsoft.com/en-us/library/317sza4k.aspx
Here is what i'm experencing...
whenever i call the isinrole fucntion this way from my usercontrol
Roles.IsUserInRole(Page.User.Identity.Name.ToStrin g,"Rolename")
the GetRolesForUser is actually called in the new role provider.
However, if i call the function this way
Roles.IsUserInRole("username","Rolename")
it calls the IsUserInRole correctly.
So, it appears that i can only get to the right function if i hard code the
username. but, if i try to get it from the Page.User.Identity.Name.ToString
variable, it does not work (even though this variable holds the correct
username).
Is there any reason why the GetRolesForUser is called? i don't understand
why this is so and i never called it.