473,385 Members | 1,555 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

No context for HttpContext in class

KJS
This is a C# web app.

The Object HTTPContext is not available in my class. I need to grab an
instance of the Current context with something like:

HTTPContext c = HTTPContext.Current;

The problem is, HTTPContext is not available to my intellisence, even
though I have System.Web above. This is a class object which a web
class form would be utilizing, but am stuck with no context (no
intellisence).

Any idea what might be wrong?
Dec 21 '05 #1
3 2285
KJS
Ok, let me throw out an important piece: the class which I need the
current context is of another project. So I have somthing like:

mySolution
webAppProject
default.cs
myUtilitiesProject
myXMLParser.cs
myDatabaseClass.cs

So, I need Current context across projects. Is this possible?

Karl..
In article <MP************************@news.cox.net>,
ka***********@hotmail.com says...
This is a C# web app.

The Object HTTPContext is not available in my class. I need to grab an
instance of the Current context with something like:

HTTPContext c = HTTPContext.Current;

The problem is, HTTPContext is not available to my intellisence, even
though I have System.Web above. This is a class object which a web
class form would be utilizing, but am stuck with no context (no
intellisence).

Any idea what might be wrong?

Dec 21 '05 #2
KJS
This is a big fat NEVERMIND! I figured it out, just needed to add the
reference to the project for System.Web.DLL

Dohhh!

(maybe this helps someone else)

In article <MP************************@news.cox.net>,
ka***********@hotmail.com says...
Ok, let me throw out an important piece: the class which I need the
current context is of another project. So I have somthing like:

mySolution
webAppProject
default.cs
myUtilitiesProject
myXMLParser.cs
myDatabaseClass.cs

So, I need Current context across projects. Is this possible?

Karl..
In article <MP************************@news.cox.net>,
ka***********@hotmail.com says...
This is a C# web app.

The Object HTTPContext is not available in my class. I need to grab an
instance of the Current context with something like:

HTTPContext c = HTTPContext.Current;

The problem is, HTTPContext is not available to my intellisence, even
though I have System.Web above. This is a class object which a web
class form would be utilizing, but am stuck with no context (no
intellisence).

Any idea what might be wrong?

Dec 21 '05 #3
hi,

nice monologue :)

glad you find the solution though.
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"KJS" <ka***********@hotmail.com> wrote in message
news:MP************************@news.cox.net...
This is a big fat NEVERMIND! I figured it out, just needed to add the
reference to the project for System.Web.DLL

Dohhh!

(maybe this helps someone else)

In article <MP************************@news.cox.net>,
ka***********@hotmail.com says...
Ok, let me throw out an important piece: the class which I need the
current context is of another project. So I have somthing like:

mySolution
webAppProject
default.cs
myUtilitiesProject
myXMLParser.cs
myDatabaseClass.cs

So, I need Current context across projects. Is this possible?

Karl..
In article <MP************************@news.cox.net>,
ka***********@hotmail.com says...
> This is a C# web app.
>
> The Object HTTPContext is not available in my class. I need to grab an
> instance of the Current context with something like:
>
> HTTPContext c = HTTPContext.Current;
>
> The problem is, HTTPContext is not available to my intellisence, even
> though I have System.Web above. This is a class object which a web
> class form would be utilizing, but am stuck with no context (no
> intellisence).
>
> Any idea what might be wrong?
>

Dec 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Srini | last post by:
I am implementing Front Controller in ASP.net as outlined in Microsoft documentation titled "Implementing Front Controller in ASP.NET Using HTTPHandler"...
0
by: Michael McDaniel | last post by:
I have overridden HttpApplication in my class library. When my application starts, There are configuration files that I need to load in order for my application to work correctly. This works...
3
by: Seth | last post by:
I have been trying to create a mock httpcontext for the purpose of unit testing. I have a class, Customer, that uses cookies. I have set it up to be able to take a httpcontext as a parameter in...
5
by: | last post by:
Hoping someone can help with a simple but puzzling problem. I have some code that I want to build as a class method. The code works fine when I embed it in Page_Load. But when I try to generalize...
2
by: Jimbo | last post by:
Hey Have a real problem here. I have a page that consists of a lot of div tags and everything on the page is made in controls. In one of the controls we call a method in another class that...
2
by: nalbayo | last post by:
what's the difference between HttpContext.Current.User.Identity.Name; and Context.User.Identity.Name; thanks!
1
by: Greg Hurlman | last post by:
I have an HttpModule that captures the FormsAuthenticationModule.Authenticate event, and replaces the HttpContext principal with a custom principal. The code is straightforward enough, yet when...
0
by: Daniel Meier | last post by:
Hi I'm using a custom PageHandlerFactory as it's used in Microsofts p&p WebClient Software Factory. The problem is, that I cannot use Sessions now; HttpContext.Current.Session is null. When I...
8
by: rn5a | last post by:
I have a user control named Enter.ascx which has 2 TextBoxes. The 2 TextBoxes are named txt1 & txt2. The entire logic of this user control (like the properties of the 2 TextBoxes using set/get...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.