Click here to Skip to main content
15,905,877 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When I am using Different Class Library and want to save some document then error showing The name 'HttpContext' does not exist in the current context

if u have any ideas about this then please give me urgent.

Thanks


Sanjay
Posted
Updated 16-Jul-12 23:26pm
v2
Comments

Hi,
Quote:
The name 'HttpContext' does not exist in the current context

Try this:
C#
System.Web.HttpContext
//Add System.Web.dll by right clicking to your solution explorer -> Add reference


--Amit
 
Share this answer
 
v2
Comments
Member 12043824 9-May-16 9:43am    
Thanks Amit.
Noa
Add reference
C#
System.web
to your Webapplication Or Class library
 
Share this answer
 
Comments
sanju mishra 17-Jul-12 5:34am    
I m not getting System.Web during adding Reference
httpContext supports only the in UI Page Solution.....Try it.......
 
Share this answer
 
Add reference in solution pane i.e.at your class liabrary
Then add the namespace to .cs file
as
C#
using System.web;

 
Share this answer
 
You are trying to mix the UI layer with the business layer. This is not advisable.

On the UI layer, get the values from the HttpContext and then call the method written in the class library.Only the required HttpContext values will then be passed as parameter to this method.
 
Share this answer
 
1) Right click on project
2) Add Reference
3) Assemblies-> Framework
4) Add namespace system.web
 
Share this answer
 
Comments
CHill60 25-Dec-13 9:12am    
See Solution 1 from a year and a half ago
hi ,

please include using System.Web; namespace in ur page at top.

kkakadiya
 
Share this answer
 
Comments
sanju mishra 17-Jul-12 6:57am    
Already Added System.Web
ssweee32 17-Jul-12 9:16am    
i agree, this usually works 100%


regards,

Sanaan Barzinji
write like this
C#
System.Web.HttpContext

or on top write like this
C#
using System.Web;
 
Share this answer
 
Just try rebuild the solution :P
Its working dudes
 
Share this answer
 
Comments
CHill60 13-Feb-14 15:25pm    
Somehow I doubt that fixed his problem 2 years ago.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900