Partilhar via


HttpResponse.ApplyAppPathModifier(String) Método

Definição

Adiciona uma ID de sessão ao caminho virtual se a sessão estiver usando Cookieless o estado da sessão e retornar o caminho combinado. Se Cookieless o estado da sessão não for usado, ApplyAppPathModifier(String) retornará o caminho virtual original.

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

Parâmetros

virtualPath
String

O caminho virtual para um recurso.

Retornos

O virtualPath com a ID da sessão inserida.

Exemplos

O exemplo a seguir declara uma variável de cadeia de caracteres chamada urlConvertede a define como o resultado de uma ApplyAppPathModifier chamada de método. Em seguida, o código passa o valor da variável para a propriedade de NavigateUrl um HyperLink controle.

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

Comentários

ApplyAppPathModifier é usado apenas com sessões sem cookie para construir HREFs absolutos.

Aplica-se a