Share via


LinkFieldValue.UseDefaultIcon property

Gets or sets a value that determines whether an IconUrl property is the default URL that is looked up, based on the NavigateUrl property.

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

Syntax

'Declaration
Public Property UseDefaultIcon As Boolean
    Get
    Set
'Usage
Dim instance As LinkFieldValue
Dim value As Boolean

value = instance.UseDefaultIcon

instance.UseDefaultIcon = value
public bool UseDefaultIcon { get; set; }

Property value

Type: System.Boolean
A flag that determines whether an IconUrl defaults to the type icon based on the NavigateUrl. The default is False.
If set to True, the IconUrl defaults to the type icon based on the NavigateUrl. Otherwise, set to False.

Remarks

The type icon is based on the image icon file configured in the current SPWeb for the file extension found in the NavigateUrl property. If no file extension or no Web is found, this method uses a generic icon.

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

GetDefaultIconUrl

IconUrl