UserControl.Request Property

Gets the HttpRequest object for the current Web request.

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

'Declaration
Public ReadOnly Property Request As HttpRequest
'Usage
Dim instance As UserControl
Dim value As HttpRequest

value = instance.Request

/** @property */
public HttpRequest get_Request ()

public function get Request () : HttpRequest

Not applicable.

Property Value

The HttpRequest object associated with the Page that contains the UserControl instance.

The following example uses the Request property to obtain the physical path of the user control. With an ID property set to myControl, the user control's location is obtained by a containing page or user control using the myControl.Request.Path syntax.


myControl.Response.Write("<br /><b>The server code is running on machine</b> : " + myControl.Server.MachineName)
Dim actualServerPath As String = myControl.MapPath(myControl.Request.Path)


     
myControl.get_Response().Write("<br /><b>The server code is" 
    + "running on machine</b> : "
    + myControl.get_Server().get_MachineName());

String actualServerPath =
    myControl.MapPath(myControl.get_Request().get_Path());

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: