Link to home
Start Free TrialLog in
Avatar of garystark
garystarkFlag for Afghanistan

asked on

global.asax - unable to get user identity

I'm trying to retrieve the user's AD name to set it into a session variable.  The line for retrieving the name is:

      string ADName;
      ADName = Page.User.Identity.Name.Substring(3);

This code works in my other pages, but I can't get it to work in my global.asax.  Visual Studio underlines "Page.User" with the following error message:

    An object reference is required for the nonstatic field, method, or property 'System.Web.UI.Page.User'

Any help is much appreciated.  If it's as simple as including a missing "using" statement, there's a part two to the question....how does one find out which "using" statement is needed?

gary
ASKER CERTIFIED SOLUTION
Avatar of SteveGTR
SteveGTR
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial