AquaLogic Interaction Development Kit (IDK) 6.0.0 |

# IFolder.AddAssociatedPortletID Method

Adds an association of a portlet to this folder.

void AddAssociatedPortletID(
int portletID
);

#### Parameters

portletID
  The portlet ID to associate with the folder.

#### Remarks

If a folder is associated with a portlet, then all its contents, including its subfolders, can be indexed and made searchable when they are published. See `IPresentationTemplate.Searchable` for more information.

Note: The recommended way to associate a portlet with a content folder is through the portlet administration settings in the portal.

In order to associate a portlet ID with a folder the portlet ID must be associated with a Presentation Template or content item in that folder or one of its subfolders. To associate a portlet ID with a Presentation Template, use `IPresentationTemplate.SetAssociatedPortletID`. To associate a portlet ID with a content item, use `IContentItem.SetAssociatedPortletID`. If the portlet ID is not associated with a content item or Presentation Template in the folder or one of its subfolders, a `ContentException` will be thrown when `Store` is called on the folder.

If the portlet ID does not refer to a valid portlet, a `ContentException` will be thrown when `Store` is called. The ID of a portlet can be retrieved using methods in `Plumtree.Remote.PRC.IPortletManager` or `Plumtree.Remote.PRC.IPortletTemplateManager`.

Note: A folder can have multiple portlet IDs associated with it, but a portlet can only be associated with one folder at a time. If the portlet ID is already associated with another folder, an `InvalidOperationException` will be thrown when `Store` is called.

The portlet ID association will not be persisted until `Store` is called.

#### Exceptions

Exception Type | Condition
--- | ---
InvalidOperationException | The folder has been deleted.
ArgumentException | The portlet ID is less than or equal to 0.

#### See Also

IFolder Interface | Plumtree.Remote.PRC.Content.Folder Namespace | Searchable | SetAssociatedPortletID | SetAssociatedPortletID