I am getting an error when coding in Visual Studio 2010 stating `Cannot access non-static field _cf in static context`, can somebody please explain why I am getting this message and if possible how to resolve this issue?

**CommonFunctions.cs**

```
namespace WebApplication1.Functions
{
    public class CommonFunctions
    {
        public string CurrentUser()
        {
            string login = HttpContext.Current.User.ToString();
            string[] usplit = login.Split('\\');
            string name = usplit[1];
            return name;
        }
    }
}

```

**Team.aspx.cs**

```
namespace WebApplication1
{
    public partial class Team : System.Web.UI.Page
    {
        private readonly CommonFunctions _cf = new CommonFunctions();

        public string CurrentUser = _cf.CurrentUser();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(CurrentUser))
            {
                // Do stuff here
            }
            else
            {
                // Do other stuff here
            }
        }
    }
}

```

I can put the `CurrentUser` code direct into the `protected void Page_Load` function but as I need to reuse `CurrentUser` throughout the project it seems ludicrous to replicate.

Any help would be much appreciated :-)