Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
ApplyAppPathModifier Method

HttpResponse.ApplyAppPathModifier Method

Adds a session ID to the virtual path if the session is using Cookieless session state and returns the combined path. If Cookieless session state is not used, ApplyAppPathModifier returns the original virtual path.

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

public string ApplyAppPathModifier(
	string virtualPath


Type: System.String

The virtual path to a resource.

Return Value

Type: System.String
The virtualPath with the session ID inserted.

ApplyAppPathModifier is used only with cookieless sessions to construct absolute HREFs.

The following example declares a string variable named urlConverted, and sets it to the result of an ApplyAppPathModifier method call. The code then passes the variable's value to a HyperLink control's NavigateUrl property.

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1
© 2015 Microsoft