Freigeben über


HttpResponse.ApplyAppPathModifier(String) Methode

Definition

Fügt dem virtuellen Pfad eine Sitzungs-ID hinzu, wenn die Sitzung den Sitzungszustand verwendet Cookieless und den kombinierten Pfad zurückgibt. Wenn Cookieless der Sitzungszustand nicht verwendet wird, ApplyAppPathModifier(String) wird der ursprüngliche virtuelle Pfad zurückgegeben.

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

Der virtuelle Pfad zu einer Ressource.

Gibt zurück

Die virtualPath mit der eingefügten Sitzungs-ID.

Beispiele

Im folgenden Beispiel wird eine Zeichenfolgenvariable namens deklariert urlConvertedund auf das Ergebnis eines ApplyAppPathModifier Methodenaufrufs festgelegt. Der Code übergibt dann den Wert der Variablen an die Eigenschaft eines HyperLink Steuerelements 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

Hinweise

ApplyAppPathModifier wird nur für cookielose Sitzungen verwendet, um absolute HREFs zu erstellen.

Gilt für: