Passing HttpContext reference as an input parameter

J

josephpage

I have a Visitor class that is defined in a class library.
The class has lots of parameters that are pulled from the QueryString,
the ReferrerUrl, Cookies, the Session object, etc...

I would like to make a constructor for the Visitor class that accepts
an HttpContext instance from within Session_Start in Global.asax.cs as
an input parameter.

The problem is that I can't figure out how to reference HttpContext
from within my Visitor class.

System.Web has a reference to HttpContext within Global.asax.cs, but
not from within the class library that contains the Visitor class

I only need to read the information in the HttpContext if the issue
revolves around not being able to manipulate HttpContext information
outside the ASP.Net project.

Thank you for any insights,

Joe
 
K

Karl Seguin

Have you tried looking at HttpContext.Current ?

dim current as HttpContext = HttpContext.Current
current.Request...

Karl
 

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,774
Messages
2,569,599
Members
45,162
Latest member
GertrudeMa
Top