HttpResponse.ApplyAppPathModifier(String) Metod

Definition

Lägger till ett sessions-ID i den virtuella sökvägen om sessionen använder Cookieless sessionstillstånd och returnerar den kombinerade sökvägen. Om Cookieless sessionstillståndet inte används ApplyAppPathModifier(String) returnerar den ursprungliga virtuella sökvägen.

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

Parametrar

virtualPath
String

Den virtuella sökvägen till en resurs.

Returer

Med virtualPath sessions-ID infogat.

Exempel

I följande exempel deklareras en strängvariabel med namnet urlConvertedoch den anges till resultatet av ett ApplyAppPathModifier metodanrop. Koden skickar sedan variabelns värde till en HyperLink kontrolls NavigateUrl egenskap.

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

Kommentarer

ApplyAppPathModifier används endast med cookielösa sessioner för att skapa absoluta HREF:er.

Gäller för