开发者

Problem with retrieveing a stored cookie

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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜