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.String
URL for which to get default type icon.
- web
Type: Microsoft.SharePoint.SPWeb
Web 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 href 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 Newhref.
currentFieldValue.IconUrl =
LinkFieldValue.GetDefaultIconUrl(Newhref, listItemWithLinkField.Web);
Note
This example is part of the larger LinkFieldValue sample in the LinkFieldValue topic.