Export (0) Print
Expand All
0 out of 2 rated this helpful - Rate this topic

HttpRequest.PathInfo Property

Gets additional path information for a resource with a URL extension.

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

public string PathInfo { get; }
/** @property */
public String get_PathInfo ()

public function get PathInfo () : String

Not applicable.

Property Value

Additional path information for a resource.

For the URL Http://www.contoso.com/virdir/page.html/tail, the PathInfo value is /tail.

The following code example determines whether the PathInfo property contains an empty string. If it does, the Write method writes a string indicating this to a file. If it does not, the HtmlEncode method HTML-encodes the value of the PathInfo property and the WriteLine method writes the encoded value to the file. This code example is part of a larger example provided for the HttpRequest class.

// Write the PathInfo property value
// or a string if it is empty.
if (Request.PathInfo == String.Empty)
{
    sw.WriteLine("The PathInfo property contains no information.");
}
else
{
    sw.WriteLine(Server.HtmlEncode(Request.PathInfo));
}

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

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.