Condividi tramite


HttpResponse.ApplyAppPathModifier(String) Metodo

Definizione

Aggiunge un ID sessione al percorso virtuale se la sessione usa Cookieless lo stato della sessione e restituisce il percorso combinato. Se Cookieless lo stato della sessione non viene utilizzato, 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

Oggetto virtualPath con l'ID sessione inserito.

Esempio

Nell'esempio seguente viene dichiarata una variabile stringa denominata urlConvertede viene impostata 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