Freigeben über


HttpResponse.ApplyAppPathModifier-Methode

Fügt dem virtuellen Pfad eine Sitzungs-ID hinzu, wenn für die Sitzung ein Cookieless-Sitzungszustand verwendet wird, und gibt den kombinierten Pfad zurück. Wenn der Cookieless-Sitzungszustand nicht verwendet wird, gibt ApplyAppPathModifier den ursprünglichen virtuellen Pfad zurück.

Namespace: System.Web
Assembly: System.Web (in system.web.dll)

Syntax

'Declaration
Public Function ApplyAppPathModifier ( _
    virtualPath As String _
) As String
'Usage
Dim instance As HttpResponse
Dim virtualPath As String
Dim returnValue As String

returnValue = instance.ApplyAppPathModifier(virtualPath)
public string ApplyAppPathModifier (
    string virtualPath
)
public:
String^ ApplyAppPathModifier (
    String^ virtualPath
)
public String ApplyAppPathModifier (
    String virtualPath
)
public function ApplyAppPathModifier (
    virtualPath : String
) : String

Parameter

  • virtualPath
    Der virtuelle Pfad zu einer Ressource.

Rückgabewert

Der virtualPath mit der eingefügten Sitzungs-ID.

Hinweise

ApplyAppPathModifier wird nur mit Sitzungen ohne Cookies verwendet, um absolute HREFs zu erstellen.

Beispiel

Im folgenden Codebeispiel wird eine Zeichenfolgenvariable mit dem Namen urlConverted deklariert, die auf das Ergebnis eines ApplyAppPathModifier-Methodenaufrufs festgelegt wird. Anschließend wird im Code der Wert der Variablen an eine href-Eigenschaft des HyperLink-Steuerelements übergeben.

' Declare a string variable and set it to the result
' of a call to the ApplyAppPathModifier method.
' Then set the href property of a Hyperlink control
' to the string's value.
Dim urlConverted As String = Response.ApplyAppPathModifier("TestPage.aspx")
hlTest1.href = urlConverted
// Declare a string variable and set it to the result
// of a call to the ApplyAppPathModifier method.
// Then set the href property of a Hyperlink control
// to the string's value.
string urlConverted = Response.ApplyAppPathModifier("TestPage.aspx");
hlTest1.href = urlConverted;

Plattformen

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

HttpResponse-Klasse
HttpResponse-Member
System.Web-Namespace