Share via


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.String

    URL 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 NewNavigateUrl
currentFieldValue.Text = NewTextPrefix +
LinkFieldValue.GetDefaultDisplayText(NewNavigateUrl) +
NewTextSuffix;

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