LinkFieldValue.GetDefaultIconUrl method
Returns a URL to a default Microsoft Office SharePoint Server 2007 type icon to use for the file type in the inputUrl.
Namespace: Microsoft.SharePoint.Publishing.Fields
Assembly: Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)
Syntax
'Declaration
Public Shared Function GetDefaultIconUrl ( _
inputUrl As String, _
web As SPWeb _
) As String
'Usage
Dim inputUrl As String
Dim web As SPWeb
Dim returnValue As String
returnValue = LinkFieldValue.GetDefaultIconUrl(inputUrl, _
web)
public static string GetDefaultIconUrl(
string inputUrl,
SPWeb web
)
Parameters
inputUrl
Type: System.StringURL for which to get default type icon.
web
Type: Microsoft.SharePoint.SPWebWeb to use for looking up the correct type icon URL.
Return value
Type: System.String
A URL to a default Microsoft Office SharePoint Server 2007 type icon to use for the file type in the inputUrl.
Remarks
The type icon to use is based on the image icon file configured in the Web for the file extension found in the NavigateUrl property. If no file extension is found or the Web parameter is null, this method uses a generic icon.
Examples
// Use the static GetDefaultIconUrl method to find the correct
// icon URL in the given Web for the file extension in NewNavigateUrl.
currentFieldValue.IconUrl =
LinkFieldValue.GetDefaultIconUrl(NewNavigateUrl, listItemWithLinkField.Web);
Note
This example is part of the larger LinkFieldValue sample in the LinkFieldValue topic.