Partilhar 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 href 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 href. The default is False.
If set to True, the IconUrl defaults to the type icon based on the href. 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 href 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 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

LinkFieldValue Class

LinkFieldValue Members

Microsoft.SharePoint.Publishing.Fields Namespace

GetDefaultIconUrl

IconUrl