Solved

global.asax - unable to get user identity

Posted on 2004-04-27
1
1,296 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

705 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