This error normally occurs when you are trying to access a property such as Request.Cookies and you’re not doing that from a webform, usercontrol or a class that inherits from System.Web.UI.
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"]; |