Thursday, July 10, 2008

Add a Web Part to SharePoint Page Programmatically

Adding web parts to a page programmatically can be done through the SPLimitedWebPartManager object.

However, if you plan to store you web part's in galleries you need to retrieve them. Web Part Galleries are just traditional SharePoint lists, so you'll need to search through the list, and retrieve the content of the item in order to retrieve the web part xml. SharePoint doesn't offer any special Web Part lists.

The blog describes the model fairly detailled.

No comments: