• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

Bug encountered when using Visual Studio 2005


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?

1 Solution
try HttpContext.Current.User.Identity.Name
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now