Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Passing HttpContext reference as an input parameter

Reply
Thread Tools

Passing HttpContext reference as an input parameter

 
 
josephpage@gmail.com
Guest
Posts: n/a
 
      04-13-2005
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

 
Reply With Quote
 
 
 
 
Karl Seguin
Guest
Posts: n/a
 
      04-13-2005
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!)


<> wrote in message
news: 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
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing parameter to function not expecting parameter Mister B C Programming 8 08-26-2010 08:01 AM
decltype as a template parameter when containing reference to anothertemplate parameter. Isti C++ 2 04-19-2010 10:01 PM
How can I keep reference to an input parameter of a function? Allerdyce.John@gmail.com C++ 4 02-27-2006 04:57 PM
Dim context As HttpContext = HttpContext.Current Tony ASP .Net Web Controls 2 03-03-2004 04:51 PM
Reference to input item as function parameter Hoschi-Ingo Javascript 6 12-03-2003 01:41 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57