global.asax

G

Guest

Hi
I referred to the MS kb#316748, and was trying to update the Global.asax,
instead of putting it directly to the file, I created a file Global.cs and
set *.asax to inherits from this *.cs file

then when I tried to compile this file, I got an error with this line
HttpCookie authCookie = Context.Request.Cookies[cookieName];

-- error --
Global.cs(94,13): error CS0246: The type or namespace name 'Context' could
not
be found (are you missing a using directive or an assembly
reference?)

How do I access the Context object here please?

TIA
--
 
D

Dominick Baier [DevelopMentor]

Hello dl,

it is available through the base class

your codebehind class should look like this

public class Global : System.Web.HttpApplication

as a side note, you can always get ahold of the context via:

HttpContext ctx = HttpContext.Current;
 
G

Guest

Thanks Dominick. How could I miss this?!

Dominick Baier said:
Hello dl,

it is available through the base class

your codebehind class should look like this

public class Global : System.Web.HttpApplication

as a side note, you can always get ahold of the context via:

HttpContext ctx = HttpContext.Current;

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
Hi
I referred to the MS kb#316748, and was trying to update the
Global.asax,
instead of putting it directly to the file, I created a file Global.cs
and
set *.asax to inherits from this *.cs file
then when I tried to compile this file, I got an error with this line
HttpCookie authCookie = Context.Request.Cookies[cookieName];
How do I access the Context object here please?

TIA
 

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

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,144
Latest member
KetoBaseReviews
Top