HttpRequest.PathInfo Property

Definition

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

C#
public string PathInfo { get; }

Property Value

The additional path information for a resource.

Examples

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.

C#
// 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));
}

Remarks

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

Applies to

Produkt Verzie
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also