开发者

ASP .Net Intranet Application How to make an Employee variable available to every page

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜