Partager via


GalleryOptions Property

The GalleryOptions property of the IAddtoGallery interface gets the XML fragment that defines the menu items added to the menu of the Add Web Parts gallery tool pane.

Property Value

String Contains the options displayed in the Web Part gallery menu.

Remarks

When a Web Part implements the IAddtoGallery interface, the GalleryOptions property is used to add menu items to the Add Web Parts tool pane. To accomplish this, the developer passes an XML fragment using the GalleryOptions property. The XML fragment specifies any and all options that will appear in Web Part gallery tool pane menu, in the order of appearance. The XML fragment has the following format:

<?xml version="1.0"?>
<GalleryOptions>
    <Option ID= "GUID">
        <OptionName>MenuItemText</OptionName>
        <LinkValue>LinkValue</LinkValue>
    </Option>
</GalleryOptions>

The schema of these XML elements are defined in the following table.

Element Description
GalleryOptions The container element for the menu item definitions.
Option Contains the definition for a single menu item. The ID attribute of this element specifies the unique id of the menu item as a GUID. If the ID value is blank or duplicate, the menu item will be ignored.
OptionName The text that will be displayed for the menu item. This element has no children and no attributes.
LinkValue Specifies the JavaScript onClick action that will run when the user clicks the menu item. This element has no children and no attributes.

To view a code sample that demonstrates setting the GalleryOptions property, see the IAddtoGallery interface topic.

Requirements

Platforms: Windows Server 2003

Security: Code Access Security