为什么HttpContext.Current.Handler为空?为空、HttpContext、Current、Handler

2023-09-03 04:22:49 作者:入他心毁我心

我想在一个HTTP模块,我想我应该调用HttpContext.Current.Handler(这应该参考当前页)这样做,但我得到空所有的时间。

I'm trying to access a Page within an HttpModule and I think I should do this by calling HttpContext.Current.Handler (This should reference the current page) but I'm getting null all the time.

我使用.net 3.5框架的发展。

I'm developing using .Net 3.5 framework.

我检查这个对的AuthorizeRequest和的AuthenticateRequest

I'm checking this on AuthorizeRequest and AuthenticateRequest

感谢。

推荐答案

也许,该请求没有被发放给一个处理程序,但(例如,你在的BeginRequest )。

Probably, the request has not been handed out to a handler yet (for example, you're in BeginRequest).