473,491 Members | 1,965 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Passing HttpContext reference as an input parameter

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
1 6473
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
34332
by: kazack | last post by:
I am a little confused with code I am looking at. My c++ book does not go into passing a structure to a function so I pulled out a c book which does. and I do not understand the prototype verses...
2
27250
by: Ed | last post by:
I need to know how to pass variables because I want to use the same function to varify multiple data imput boxes. Please tell me what's wrong with this code. <head> <script...
5
36374
by: Andy | last post by:
Hi Could someone clarify for me the method parameter passing concept? As I understand it, if you pass a variable without the "ref" syntax then it gets passed as a copy. If you pass a...
39
7591
by: Mike MacSween | last post by:
Just spent a happy 10 mins trying to understand a function I wrote sometime ago. Then remembered that arguments are passed by reference, by default. Does the fact that this slowed me down...
4
3791
by: sam1967 | last post by:
How do I get a function to return a GMP integer type mpz_t when i try it i get an error message. i am trying mpz_t hooch (int x) { mpz_t y; ........
15
6668
by: James Higgs | last post by:
For a long time, our product has had a "vanity URLs" feature where nice URLs are mapped to ASPX files in an IHttpModule implementation, using HttpContext.RewritePath(). This has worked beautifully...
11
8090
by: John Pass | last post by:
Hi, In the attached example, I do understand that the references are not changed if an array is passed by Val. What I do not understand is the result of line 99 (If one can find this by line...
2
2009
by: Nab | last post by:
I have just tried to pass parameters to a procedure in VB 2005 and realised that you only need to pass the input parameter. The output parameter's value will be returned without the need to pass it...
7
3286
by: TS | last post by:
I was under the assumption that if you pass an object as a param to a method and inside that method this object is changed, the object will stay changed when returned from the method because the...
0
6978
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7154
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6858
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7360
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5451
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4881
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3086
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.