Monday, April 14, 2008

The Name 'Request' does not exist in the current context

Nothing to worry about, since you can still access these properties, but using a different path.For example to access a cookie with the name MyCookie you would normally use Request.Cookies["MyCookie"]; however, if the error The name 'Request' does not exist in the current context is returned, use the following path for retrieving the cookie:
System.Web.HttpContext.Current.Request.Cookies["MyCookie"].value;

1 comment:

Kelly Carter said...

Thanks. That fixed a problem for me, after I had tried a number of other suggested fixes.