system.web and HttpContext

G

Gilgamesh

We're developing a C# assemlbly in .net 2.0 and we don't see HttpContext
class in System.Web.
Anybody knows what happened to it? We need HttpContext in order to access
the Request object.

Thanks,
GIlgamesh
 
A

Alberto Poblacion

Gilgamesh said:
We're developing a C# assemlbly in .net 2.0 and we don't see HttpContext
class in System.Web.
Anybody knows what happened to it? We need HttpContext in order to access
the Request object.

It is there, I've used it lots of times. Are you sure that you have added
the System.Web.dll assembly to your project References?
 
G

Gilgamesh

Yes. Are you sure you're not talking about asp.net application? In my case,
it's a C# assembly.
-G
 
A

Alberto Poblacion

Gilgamesh said:
Yes. Are you sure you're not talking about asp.net application? In my
case, it's a C# assembly.

If it were an asp.net application you would not need to go into the
References to add System.Web.dll, because the standard template for asp.net
already contains the reference. It is only when you create a new class
library that you need to add the Reference.

I assume that when you say "a C# assembly" you are referring to a class
library to be called from an asp.net application, since otherwise it
wouldn't make sense to use HttpContext. Note that an .exe file is also an
assembly and that an asp.net application also gets compiled into an assembly
when you run it.

Anyway, I've just done it: I went into one of my projects in Visual Studio
2005, selected "Add Reference" and added System.Web, then went into one of
the .cs files in the project and added "using System.Web;", then typed
"HttpContext." in the source code, and it was immediately recognized by
Intellisense.
 
G

Gilgamesh

It worked. Thanks a lot!
-G
Alberto Poblacion said:
If it were an asp.net application you would not need to go into the
References to add System.Web.dll, because the standard template for
asp.net already contains the reference. It is only when you create a new
class library that you need to add the Reference.

I assume that when you say "a C# assembly" you are referring to a class
library to be called from an asp.net application, since otherwise it
wouldn't make sense to use HttpContext. Note that an .exe file is also an
assembly and that an asp.net application also gets compiled into an
assembly when you run it.

Anyway, I've just done it: I went into one of my projects in Visual
Studio 2005, selected "Add Reference" and added System.Web, then went into
one of the .cs files in the project and added "using System.Web;", then
typed "HttpContext." in the source code, and it was immediately recognized
by Intellisense.
 

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

Top