Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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(href) 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 Newhref = "/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
Microsoft.SharePoint.Publishing.Fields Namespace
href