Solved

global.asax - unable to get user identity

Posted on 2004-04-27
1
1,235 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 500 total points
ID: 10934125
Do this:

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

Good Luck,
Steve
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Automatic sizing of HTML.TextAreaFor based on content 1 26
Problem to page 4 74
Error in JQuery 5 38
Make an ajax call ithat alters url and updates a listview in asp.net 1 22
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

910 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now