HttpResponse.ApplyAppPathModifier(String) Metodo

Definizione

Aggiunge un ID sessione al percorso virtuale, se la sessione utilizza lo stato di sessione Cookieless e restituisce il percorso combinato. Se non viene utilizzato lo stato di sessione Cookieless il metodo ApplyAppPathModifier(String) restituisce il percorso virtuale originale.

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

Parametri

virtualPath
String

Percorso virtuale di una risorsa.

Restituisce

virtualPath con l'ID sessione inserito.

Esempio

Nell'esempio seguente viene dichiarata una variabile stringa denominata urlConvertede la imposta sul risultato di una ApplyAppPathModifier chiamata al metodo. Il codice passa quindi il valore della variabile alla proprietà di NavigateUrl un HyperLink controllo.

// 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

Commenti

ApplyAppPathModifier viene usato solo con sessioni senza cookie per costruire HREFs assoluti.

Si applica a