Dim context As HttpContext = HttpContext.Current

T

Tony

Hi there,

I reference namespace and imports System.Web on my spcifice class and then
I declared:

Dim context As HttpContext = HttpContext.Current

I always got httpcontext is not defined. Any suggestion would be
appreciated.

Sandra
 
S

SB

Hello Sandra
You don't need to create an instance of the class. You can use its static
methods straight away.
Selim
 
T

Teemu Keiski

Hi,

do you use the class in conjuction with web request for example Page uses it
or such? HttpContext exists only in web context so it cannot be used outside
of it. Where are you using this line of code, show some more code.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist


Hi there,

I reference namespace and imports System.Web on my spcifice class and then
I declared:

Dim context As HttpContext = HttpContext.Current

I always got httpcontext is not defined. Any suggestion would be
appreciated.

Sandra
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top