IWebPart::TitleIconImageUrl Property
Gets or sets the URL to an image used to represent a Web Parts control in the control's own title bar.
Assembly: System.Web (in System.Web.dll)
Property Value
Type: System::StringA string that represents the URL to an image. The default value is an empty string ("").
The TitleIconImageUrl property provides a way to associate an icon with a WebPart control. The icon appears in the control's own title bar. For thematic consistency, application developers might want to make this icon similar to the image that represents the control in a catalog of Web Parts controls (the image referenced in the CatalogIconImageUrl property).
As it is implemented in the Web Parts control set, the TitleIconImageUrl property can be personalized by end users to change the image or icon that appears in a control's title bar.
The following code example demonstrates declarative and programmatic use of the TitleIconImageUrl property. The complete source code for the example is found in the Example section of the IWebPart class overview.
The first part of the code example shows how the user control implements the TitleIconImageUrl property.
The second part of the code example demonstrates the method in the user control that programmatically sets the value of the TitleIconImageUrl property when a user selects the appropriate property name from the radio buttons on the page, sets a new value in the text box, and then clicks the Update button.
Security Note |
|---|
This example has a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see Script Exploits Overview. |
The third part of the code example shows how the user control that implements the IWebPart interface is referenced in a WebPartZone control, and how the TitleIconImageUrl property is set declaratively on the control. Note that if you do not provide the URL to a real image, a placeholder for the icon appears in the title bar.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Security Note