Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

WebPart.TitleIconImageUrl property

Gets or sets the URL to an image used to represent the Web Part in its own title bar.

Namespace:  Microsoft.SharePoint.WebPartPages
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

[WebPartStorageAttribute(Storage.None)]
public override string TitleIconImageUrl { get; set; }

Property value

Type: System.String
A string containing a URL. The default value is String.Empty.

Implements

IWebPart.TitleIconImageUrl

The TitleIconImageUrl property provides a way to place a small image in a Web Part control’s title bar. For thematic consistency, application developers often make this icon similar to the image that represents the control in a catalog of Web Part controls (the image referenced in the CatalogIconImageUrl property).

You can set a value for the property programmatically in the code for the control or declaratively in the markup of a Web Part control description file (.webpart).

The following example shows how to set the TitleIconImageUrl property declaratively in a Web Part control description file. This example uses the Web Part created in Walkthrough: Creating a Basic SharePoint Web Part.

<?xml version="1.0" encoding="utf-8" ?> 
  <webParts>
     <webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
       <metaData>
         <type name="MyWebParts.SimpleWebPart, Version=1.0.0.0, Culture=neutral,
         PublicKeyToken=PublicKeyToken" /> 
         <importErrorMessage>Cannot import this Web 
         Part.</importErrorMessage> 
       </metaData>
       <data>
         <properties>
           <property name="Title" type="string">My Simple Web Part</property>
           <property name="Description" type="string">A simple Web Part</property>
            <property name= "TitleIconImageUrl" type="string">/_layouts/images/mscntvwl.gif</property>
         </properties>
       </data>
     </webPart>
   </webParts>
Show:
© 2015 Microsoft