How to get .NET HttpContext for isolated code block

Posted by Matt Thrower on Stack Overflow See other posts from Stack Overflow or by Matt Thrower
Published on 2010-04-09T09:51:38Z Indexed on 2010/04/09 9:53 UTC
Read the original article Hit count: 420

Filed under:
|

Hi,

In .NET is it possible to get the HttpContext of the current page from within an external class?

So, for example in my page test1.aspx codebehind I've got:

    Dim blah As New FeedWriter()
    blah.Run()

But inside FeedWriter.vb, can I get the HttpContext of test1.aspx? Or would I have to pass it in to Run()? (I'm unwilling to do the latter because FeedWriter implements an interface which will need to be re-written if it's to take arguments)

Cheers, Matt

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about httpcontext