PostAuthenticateRequest의 Global.asax 이벤트는 어떻게 사용할 수 있습니까? this tutorial을 따라 가고 있는데 PostAuthenticateRequest 이벤트를 사용해야한다고 언급합니다. Global.asax 이벤트를 추가하면 마크 업과 코드 숨김 파일이라는 두 개의 파일이 생성되었습니다. 여기에 파일Global.asax PostAuthenticateRequest 이벤트 바인딩은 어떻게 발생합니까?
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 메서드에 바인딩 된 것을 알고 싶습니다. 방법을 다른 방법으로 변경하려면 어떻게해야합니까?
대신 다음과 같은 작성합니다. 이벤트를 구현하는 방법을 묻는 게시물을 올리려고했지만 그때 시도해보고 오류가 있는지 살펴 보겠습니다. 그것은 일했다 :) 어쨌든 고마워 – Tux
조심하십시오. Application_Start 또는 Session_Start는 Auto Event Wireup 메커니즘을 통해서만 처리 할 수 있습니다. 구독 할 수있는 HttpApplication 클래스에는 명시 적 이벤트가 없습니다. –
알려 주셔서 감사합니다. – Tux