LinkFieldValue.GetDefaultDisplayText Method
Returns default display text to use for the inputUrl.
Namespace: Microsoft.SharePoint.Publishing.Fields
Assembly: Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)
Syntax
'Declaration
Public Shared Function GetDefaultDisplayText ( _
inputUrl As String _
) As String
'Usage
Dim inputUrl As String
Dim returnValue As String
returnValue = LinkFieldValue.GetDefaultDisplayText(inputUrl)
public static string GetDefaultDisplayText(
string inputUrl
)
Parameters
inputUrl
Type: System.StringURL to get default display text for.
Return Value
Type: System.String
The default display text for the inputUrl.
Remarks
If a file name can be found in the inputUrl, it is returned as the default text. Otherwise, the URL is returned.
Examples
// Use the static GetDefaultDisplayText method to find the default
// link text for the given Newhref
currentFieldValue.Text = NewTextPrefix +
LinkFieldValue.GetDefaultDisplayText(Newhref) +
NewTextSuffix;
Note
This example is part of the larger LinkFieldValue sample in the LinkFieldValue topic.