views:

26

answers:

1

Hey,

I wanted to know if we can access the HttpContext class in the App_Code folder. I am asking so because i have a CommonMethods.cs class inside my App_Code folder.

I have written a method that checks if a cookie exists on the client machine or not, but it does not return the cookie.

Although when i write the same code on the ASPX.cs page i get the cookie!!

can anybody clarify me as in whats going on??

thanks

A: 

HttpContext is a Static class that should be available in any ASP.NET page.

To access it in a custom class you have to use the fully qualified name as in System.Web.HttpContext, or include a using statement. If it's in a custom DLL, make sure to reference the assembly.

Doobi
thanks doobi, with your help now i got my code going!!take care.
Shrewd Demon