hi,
i'm attempting to set a cookie which determines the last page that I
visited within my aspx 1.1 application. It seemed to me that the most
logical place would be within global.asax, and in particular within;
for example
protected void Application_BeginRequest(Object sender, EventArgs e)
{
HttpCookie test = new HttpCookie("test");
test.Values["Index"] = "POP";
HttpContext.Current.Request.Cookies.Add(test);
}
however this doesn't work. I really didn't want to code within each
forms 'onload' event as that seemed like a manageable nightmare,
especially when global.asax should fit the bill.
Any help/idea would be greatly appreciated.
Alex Meleta - 11 Sep 2007 10:18 GMT
Hi,
Just set it for Response, not for Request.
HttpContext.Current.*Response*.Cookies.Add(test)
Regards, Alex
[TechBlog] http://devkids.blogspot.co
hiddenhippo - 11 Sep 2007 10:50 GMT
> Hi,
>
[quoted text clipped - 3 lines]
> Regards, Alex
> [TechBlog]http://devkids.blogspot.com
thanks for that. it seems that staring at the problem caused me to go
blind. fresh pair of eyes helped big time. thanks again