LinkFieldValue.NavigateUrl property
Gets or sets the URL of the hyperlink to this LinkFieldValue object.
Namespace: Microsoft.SharePoint.Publishing.Fields
Assembly: Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)
Syntax
'Declaration
Public Property NavigateUrl As String
Get
Set
'Usage
Dim instance As LinkFieldValue
Dim value As String
value = instance.NavigateUrl
instance.NavigateUrl = value
public string NavigateUrl { get; set; }
Property value
Type: System.String
Returns the URL of the link to this LinkFieldValue object or an empty string. The value of this property is the href attribute in the <A> tag in the ToString output.
Remarks
The URL set in this property can be set to any URL reference, although some invalid values may be removed when the value is stored in a SPListItem field value. This is the primary data element for this field value. If this URL does not have a value, all other data in this object is ignored and the ToString returns an empty string.
Examples
// You can change any of the following data that will be set into the LinkFieldValue.
private const string NewNavigateUrl = "/Documents/SampleFile.docx";
private const bool NewUseDefaultIcon = false;
private const string NewTarget = "_blank";
private const string NewToolTip = "Sample tool tip for the link";
private const string NewTextPrefix = "Open [";
private const string NewTextSuffix = "] in a new window";
Note
This example is part of the larger LinkFieldValue sample in the LinkFieldValue topic.