System.UriBuilder.Fragment Property

Gets or sets the fragment portion of the URI.

Syntax

public string Fragment { get; set; }

Value

A string containing the fragment component of the URI represented by the current instance.

Remarks

The UriBuilder.Fragment property contains any text following a fragment marker (#) in the URI, including the marker itself. When setting the UriBuilder.Fragment property, the fragment marker is added to its value. Note   In version 1.0 and 1.1 of the .NET Framework, setting the UriBuilder.Fragment property to any value, including null, cleared the UriBuilder.Query property, and setting the UriBuilder.Fragment property to null or to string.Empty cleared the property. In version 2.0, however, the UriBuilder.Fragment and UriBuilder.Query properties are independent.

Note   Do not append a string directly to this property. If the length of UriBuilder.Fragment is greater than 1, retrieve the property value as a string, remove the leading pound sign, append the new query string, and set the property with the combined string.

Requirements

Namespace: System
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0