Quick Simple Question

M

Mark Fox

Hello,

Does anyone know how to access the web form's Page
object from the HttpContext object? To get to the
Response, Request, etc. it's just
HttpContext.Current.Response,
HttpContext.Current.Request, etc. How do I geta
reference to the Page object? Thanks for your help!
 
J

Jacob Yang [MSFT]

Hi Mark,

Based on my research and experience, I think it is impossible to get a
reference to certain Page object from the HttpContext, for an instance of
the HttpApplication will be created, if there is no available, to serve the
current request, and then an instance of the HttpContext class, which
encapsulates all HTTP-specific information about an individual HTTP request
will be populated. Then certain web page will be created and from the web
page we can access the instance of the HttpApplication class via the
HttpContext instance created above to get the specific info related to the
current request.

That is, the instance of the HttpContext was created before the Page object.

Does it answer your question? If you have misunderstood your concern,
please feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
<MCSD>
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top