J
Jonathan Wood
I've set up ASP.NET membership.
I can get the role(s) of the current user by calling
Roles.GetRolesForUser().
It seems like it would be a good idea to store some role-specific
calculations in the Session object so that I don't need to re-perform these
calculations for each page.
Questions:
1. Does storing data calculated from the current user's role in the Session
object seem like a good approach so I don't need to perform these
calculations again for each page?
2. Where would I do initialize this data? I tried placing code in the
LoggedIn event of my Login control. The problem is that
Roles.GetRolesForUser() seems to return an empty list at this point. I guess
it hasn't been initialized when this event is called. So where else could I
get it?
Thanks.
I can get the role(s) of the current user by calling
Roles.GetRolesForUser().
It seems like it would be a good idea to store some role-specific
calculations in the Session object so that I don't need to re-perform these
calculations for each page.
Questions:
1. Does storing data calculated from the current user's role in the Session
object seem like a good approach so I don't need to perform these
calculations again for each page?
2. Where would I do initialize this data? I tried placing code in the
LoggedIn event of my Login control. The problem is that
Roles.GetRolesForUser() seems to return an empty list at this point. I guess
it hasn't been initialized when this event is called. So where else could I
get it?
Thanks.