?
Solved

global.asax - unable to get user identity

Posted on 2004-04-27
1
Medium Priority
?
1,354 Views
Last Modified: 2012-05-04
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
0
Comment
Question by:garystark
1 Comment
 
LVL 30

Accepted Solution

by:
SteveGTR earned 2000 total points
ID: 10934125
Do this:

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

Good Luck,
Steve
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question