global.asax - unable to get user identity
Posted on 2004-04-27
I'm trying to retrieve the user's AD name to set it into a session variable. The line for retrieving the name is:
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?