Author: krokonoster | Posted on: 4/26/2010 9:48:27 AM | Views : 1155

I'm creating custom membership and role providers here, and ran into this troubles.  Thought it's something I did wrong until I created a new MVC project (MVC2) and found the same issue there.
To reproduce:
1) Create a new Asp.Net MVC project (not empty)
2) Go to the WAT (Project -> Asp.Net Configuration), create some roles, users, and assign the users to roles.
3) Add "var x =  Roles.GetRolesForUser();" after "FormsService.SignIn(model.UserName, model.RememberMe);" in your AccountController.Login (post) and place a breakpoint there.
4) Run the project and log in as one of the users you created (who should be in one or more roles)
5) Notice that Roles.GetRolesForUser() are empty.
I ran into this issue as after logging the user it, i want to redirect them to the area (route) specially for that user.  Seems sth is wrong here...?



...

Go to the complete details ...