【发布时间】:2011-01-13 07:51:01
【问题描述】:
如何使用 Global.asax 的 PostAuthenticateRequest 事件?我正在关注this tutorial,它提到我必须使用 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 方法的?如何将方法更改为其他方法?
【问题讨论】:
标签: asp.net .net events global-asax autoeventwireup