.NET Web Forms getting Page object from HttpContext
How is it possible to get a reference of Page from HttpContext object.
I have seen type casting like:
HttpContext.Current.Handler as Page
The above code gives the Page details. I am unable to understand how this is possible. Can you please help me understand as in when does HttpContext get the reference to the page. I understand, the HttpCont开发者_StackOverflow中文版ext object is meant to get the details of the current request. I agree my concepts are a bit shaky. Also I would be grateful if you could suggest some good articles to help me clear this maze :)
Thanks in advance Nick
Both of them implements IHttpHandler interface.
- http://msdn.microsoft.com/en-us/library/system.web.httpcontext.handler.aspx
- http://msdn.microsoft.com/en-us/library/system.web.ui.page.aspx
精彩评论