HttpResponse.ApplyAppPathModifier(String) Metoda

Definicja

Dodaje identyfikator sesji do ścieżki wirtualnej, jeśli sesja używa Cookieless stanu sesji i zwraca połączoną ścieżkę. Jeśli Cookieless stan sesji nie jest używany, ApplyAppPathModifier(String) zwraca oryginalną ścieżkę wirtualną.

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

Parametry

virtualPath
String

Ścieżka wirtualna do zasobu.

Zwraca

String

Element virtualPath z wstawionym identyfikatorem sesji.

Przykłady

Poniższy przykład deklaruje zmienną ciągu o nazwie urlConvertedi ustawia ją na wynik ApplyAppPathModifier wywołania metody. Następnie kod przekazuje wartość zmiennej do HyperLink właściwości kontrolki 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

Uwagi

ApplyAppPathModifier jest używany tylko w przypadku sesji bez plików cookie do konstruowania bezwzględnych plików HREFs.

Dotyczy