On just about every page in the application I do something based on 开发者_运维技巧which employee is currently logged in. Is there an easier way to access the employee other than creating a variable in the Page_Load?
You must look after Session class.
Personally I like inheriting from a class which accepts a employee ID value of some sort, although typically it's the windows identity of the signed in user.
This performs a employee load, and retrieves the appropriate properties or security credentials as needed.
This ensures the details are up to date, and they cannot be impersonated by other users easily.
You might use the built in membership and authentication providers in comination with the login server controls to get the basic functionality.
精彩评论