C# 找不到FormSideEntity的获取对象

C# 找不到FormSideEntity的获取对象,c#,asp.net,entity-framework,C#,Asp.net,Entity Framework,我正试图根据在login.aspx中创建的票证设置身份验证请求,但由于某些原因,我收到一个错误,代码如下 protected void Application_AuthenticateRequest(object sender, EventArgs e) { // Create an Identity object FormsIdentity identity = (FormsIdentity)Context.User.Identity;

我正试图根据在login.aspx中创建的票证设置身份验证请求,但由于某些原因,我收到一个错误,代码如下

    protected void Application_AuthenticateRequest(object sender, EventArgs e)
    {
        // Create an Identity object
        FormsIdentity identity = (FormsIdentity)Context.User.Identity;
        // When the ticket was created, the UserData property was assigned a
        // pipe delimited string of role names.
        string[] roles = identity.Ticket.UserData.Split(new char[] { ',' });
        String userData = identity.Ticket.UserData;
        // This principal will flow throughout the request.
        GenericPrincipal principal = new GenericPrincipal(identity, roles);
        // Attach the new principal object to the current HttpContext

    }

您必须从
应用程序\u AuthenticateRequest()
转到管道中的下一个函数:

Application\u授权请求(对象发送方,事件参数)

在此阶段,应完成windows身份验证,因为在
应用程序中\u AuthenticateRequest()
它仍然是
null
。可以找到有关管道顺序的基本信息和漂亮的可视化图表

同样,如果您使用IIS 7和asp.net 4.0运行,则应调用其中的所有登录请求:

应用程序\u PostAuthenticateRequest()(对象发送方,事件参数e)