Share via


LinkFieldValue.Text property

Gets or sets the text that is displayed for the hyperlink.

Namespace:  Microsoft.SharePoint.Publishing.Fields
Assembly:  Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)

Syntax

'Declaration
Public Property Text As String
    Get
    Set
'Usage
Dim instance As LinkFieldValue
Dim value As String

value = instance.Text

instance.Text = value
public string Text { get; set; }

Property value

Type: System.String
The text displayed in the hyperlink.
The content in the <A> tag in the ToString output.

Remarks

When there is no explicit value set for this property, the GetDefaultDisplayText(NavigateUrl) method is used as the default value for Text.

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.

See also

Reference

LinkFieldValue class

LinkFieldValue members

Microsoft.SharePoint.Publishing.Fields namespace

GetDefaultDisplayText

NavigateUrl