HttpResponse.ApplyAppPathModifier(String) Metode
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Menambahkan ID sesi ke jalur virtual jika sesi menggunakan Cookieless status sesi dan mengembalikan jalur gabungan. Jika Cookieless status sesi tidak digunakan, ApplyAppPathModifier(String) mengembalikan jalur virtual asli.
public:
System::String ^ ApplyAppPathModifier(System::String ^ virtualPath);
public string ApplyAppPathModifier(string virtualPath);
member this.ApplyAppPathModifier : string -> string
Public Function ApplyAppPathModifier (virtualPath As String) As String
Parameter
- virtualPath
- String
Jalur virtual ke sumber daya.
Mengembalikan
virtualPath dengan ID sesi yang disisipkan.
Contoh
Contoh berikut mendeklarasikan variabel string bernama urlConverted, dan mengaturnya ke hasil ApplyAppPathModifier panggilan metode. Kode kemudian meneruskan nilai variabel ke HyperLink properti kontrol NavigateUrl .
// Declare a string variable and set it to the result
// of a call to the ApplyAppPathModifier method.
// Then set the NavigateUrl property of a Hyperlink control
// to the string's value.
string urlConverted = Response.ApplyAppPathModifier("TestPage.aspx");
hlTest1.NavigateUrl = urlConverted;
' Declare a string variable and set it to the result
' of a call to the ApplyAppPathModifier method.
' Then set the NavigateUrl property of a Hyperlink control
' to the string's value.
Dim urlConverted As String = Response.ApplyAppPathModifier("TestPage.aspx")
hlTest1.NavigateUrl = urlConverted
Keterangan
ApplyAppPathModifier hanya digunakan dengan sesi tanpa cookie untuk membangun HREF absolut.