如何使用 Global.asax 的PostAuthenticateRequest事件?我正在关注本教程,它提到我必须使用PostAuthenticateRequest事件。当我添加 Global.asax 事件时,它创建了两个文件,标记和代码隐藏文件。这是代码隐藏文件的内容
using System;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
namespace authentication
{
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
}
protected void Session_Start(object sender, EventArgs e)
{
}
protected void Application_BeginRequest(object sender, EventArgs e)
{
}
protected void Application_AuthenticateRequest(object sender, EventArgs e)
{
}
protected void Application_Error(object sender, EventArgs e)
{
}
protected void Session_End(object sender, EventArgs e)
{
}
protected void Application_End(object sender, EventArgs e)
{
}
}
}
现在当我输入
protected void Application_OnPostAuthenticateRequest(object sender, EventArgs e)
它被成功调用。现在我想知道PostAuthenticateRequest是如何绑定到这个Application_OnPostAuthenticateRequest方法的?如何将方法更改为其他方法?