locked
I am getting the error: Error 375 'System.Web.Providers.Entities.User' does not contain a definition for 'Identity'. How do I fix it? RRS feed

  • Question

  • User-858993849 posted

    In codebehind, I have 

    protected void Page_Load(object sender, EventArgs e)
            {
                if (User.Identity.IsAuthenticated)
                {               
                }
            }

    I get the following error with regard to "Identity"

    System.Web.Providers.Entities.User' does not contain a definition for 'Identity

    I have the exact same "using's" of other forms without a problem, and there is no "resolve" to find one to fix the problem, so I am at a loss as to what is going on.

    Friday, December 18, 2015 8:34 PM

Answers

  • User-858993849 posted

    Adding "Context." to User  fixed the problem(Context.User.Identity.IsAuthenticated) 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, December 19, 2015 4:21 PM