Solved

global.asax - unable to get user identity

Posted on 2004-04-27
1
1,217 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
Comment Utility
Do this:

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

Good Luck,
Steve
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 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

9 Experts available now in Live!

Get 1:1 Help Now