By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,119 Members | 2,086 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,119 IT Pros & Developers. It's quick & easy.

Passing HttpContext reference as an input parameter

P: n/a
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

Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Have you tried looking at HttpContext.Current ?

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

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
<jo********@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
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

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.