Bug encountered when using Visual Studio 2005

Posted on 2006-06-07
Last Modified: 2012-05-05

I am using Visual Studio 2005 to code a web application.  however, due to environment issues, i have to code with ASP.NET 1.1.

When i try to compile this code:

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Security;
using System.Security.Principal;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Mynamespace
    public class cwdWindowsLoginID
            private string _ID;

            public cwdWindowsLoginID()
                _ID = null;

            public string ID2
                    string tempUserID = User.Identity.Name;
                    string tempUserID2 = tempUserID.Remove(0,4).ToString().ToLower().Trim();
                    return tempUserID2;


I get the following error:   the name 'user' does not exist in the current context.

I have a feeling this has something to do with the fact that User.Identity.Name is an ASP.NET 1.1 technique.

So, my question:  is it possible to change debugging settings to the .net 1.1 framework?  If not, whats the fix?

Question by:alexthecodepoet
    1 Comment
    LVL 1

    Accepted Solution

    try HttpContext.Current.User.Identity.Name

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    754 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

    25 Experts available now in Live!

    Get 1:1 Help Now