Export (0) Print
Expand All

HttpContext.Server Property

Gets the HttpServerUtility object that provides methods used in processing Web requests.

Namespace: System.Web
Assembly: System.Web (in system.web.dll)

public HttpServerUtility Server { get; }
/** @property */
public HttpServerUtility get_Server ()

public function get Server () : HttpServerUtility

Not applicable.

Property Value

The HttpServerUtility for the current HTTP request.

The Server property provides programmatic access to the properties and methods of the HttpServerUtility class. Because ASP.NET pages contain a default reference to the System.Web namespace (which contains the HttpContext class), you can reference the members of HttpContext on an .aspx page without using the fully qualified class reference to HttpContext. For example, you can use Server.CreateObject("MyCOMComponent") to create an instance of a COM object on the server. However, if you want to use the members of HttpServerUtility 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.Server.CreateObject("MyCOMComponent").

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft