Author: WilliamSnell | Posted on: 4/7/2009 2:38:04 PM | Views : 471

I'm creating classes to handle events, if the events occur in multiple places and in a sufficiently generic way. For instance, it's very common to create IO classes and classes to send emails, etc.etc.

However, working with web applications, I'd like to centralize code for things like handling actions based on the currently logged-on user. I can grab the current user by:
Page.Request.ServerVariables["LOGON_USER"].Replace("DomainStringToStripOff\\", string.Empty);
This works just fine, but I'd like to replace this call (and some others) with more terse methods. In this case, it would be something like "GetCurrentUser". The problem I'm having is that, while I can access many things in the classes contained in App_Code, Page variables don't seem to be among them. Is there a way to get access to Page variables and Se ...

Go to the complete details ...