Partager via


HttpResponse.ApplyAppPathModifier(String) Méthode

Définition

Ajoute un ID de session au chemin d’accès virtuel si la session utilise Cookieless l’état de session et retourne le chemin combiné. Si Cookieless l’état de session 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 à une ressource.

Retours

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 passe ensuite la valeur de la variable à la propriété d’un HyperLinkNavigateUrl 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 fonctions HREFs absolues.

S’applique à