Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
in an internet mvc 4 project, when run the project in debug mode,and login to application,the role for user wich was assigned before will recognized. the function that i use for getting user roles is :

System.Web.Security.Roles.GetRolesForUser(currentUser.Identity.Name)


but when i stop the debugging, and again run application in debug mode, user is authenticated but GetRolesForUser return string[0]. why does it occures and doesn't return role?
Posted
Updated 19-Apr-13 21:58pm
v2
Comments
tumbledDown2earth 20-Apr-13 4:39am    
did you check you web.config ?
zahra6688 22-Apr-13 6:16am    
yes, i enable the rolemanager in the web.config. but i think this problem is because of using WebMatrix.webData.websecurity for managing security. it seems that it doesn't support Role managing!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900