System.Web.HttpContext.Request Property

Gets the System.Web.HttpRequest object for the current HTTP request.

Syntax

public HttpRequest Request { get; }

Value

Documentation for this section has not yet been entered.

Remarks

The HttpContext.Request property provides programmatic access to the properties and methods of the System.Web.HttpRequest class. Because ASP.NET pages contain a default reference to the System.Web namespace (which contains the System.Web.HttpContext class), you can reference the members of System.Web.HttpRequest on an .aspx page without using the fully qualified class reference to System.Web.HttpContext. For example, you can use Request.Browser to get the capabilities of the client browser. However, if you want to use the members of System.Web.HttpRequest from an ASP.NET code-behind module, you must include a reference to the System.Web namespace in the module and a fully qualified reference to both the currently active request/response context and the class in System.Web that you want to use. For example, in a code-behind page you must specify the fully qualified name HttpContext.Current.Request.Browser.

Note:

ASP.NET will throw an exception if you try to use this property when the System.Web.HttpRequest object is not available. For example, this would be true in the Application_Start method of the Global.asax file, or in a method that is called from the Application_Start method. At that time no HTTP request has been created yet.

Requirements

Namespace: System.Web
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0