HttpResponse.ApplyAppPathModifier(String) Méthode

Définition

Ajoute un ID de session au chemin d'accès virtuel si la session utilise un état de session Cookieless et retourne le chemin combiné. Si l'état de session Cookieless n'est pas utilisé, ApplyAppPathModifier(String) retourne le chemin d'accès virtuel d'origine.

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

Paramètres

virtualPath
String

Chemin d’accès virtuel d’une ressource.

Retours

String

virtualPath avec l'ID de session inséré.

Exemples

L’exemple suivant déclare une variable de chaîne nommée urlConvertedet la définit sur le résultat d’un ApplyAppPathModifier appel de méthode. Le code transmet ensuite la valeur de la variable à la propriété d’un HyperLink NavigateUrl contrôle.

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

Remarques

ApplyAppPathModifier est utilisé uniquement avec les sessions sans cookie pour construire des HREFs absolus.

S’applique à