Bagikan melalui


UserControl.Request Properti

Definisi

HttpRequest Mendapatkan objek untuk permintaan Web saat ini.

public:
 property System::Web::HttpRequest ^ Request { System::Web::HttpRequest ^ get(); };
[System.ComponentModel.Browsable(false)]
public System.Web.HttpRequest Request { get; }
[<System.ComponentModel.Browsable(false)>]
member this.Request : System.Web.HttpRequest
Public ReadOnly Property Request As HttpRequest

Nilai Properti

Objek HttpRequest yang Page terkait dengan yang berisi UserControl instans.

Atribut

Contoh

Contoh berikut menggunakan Request properti untuk mendapatkan jalur fisik kontrol pengguna. Dengan properti diatur ID ke myControl, lokasi kontrol pengguna diperoleh oleh halaman yang berisi atau kontrol pengguna menggunakan myControl.Request.Path sintaks.


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


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)

Berlaku untuk

Lihat juga