Today I was working to make modifications to a site that was being provisioned via automation code. The code creates a batch of sites and then uploads various data to the site for review by members of the site. The goal of the automation is to insure a consistent user experience with web parts to containing lists and libararies in the same place. However, I couldn't see exactly where this would be accomplished in the object model of SharePoint, so I pulled up Google and began searching. I came across this post by Thomas Conté that was very helpful.
11 January 2008
Programmatically Adding Web Parts to Pages
Categories:
Customization,
Sharepoint Application Concepts
Posted by Chris at 11:59 AM
Subscribe to:
Post Comments (Atom)
2 comments:
To add/remove web parts programmatically refer following post:
http://www.etechplanet.com/post/2009/03/18/AddingRemoving-web-part-programmatically-in-SharePoint-website-using-C-Code.aspx
Avi, I just noticed today that the components being used are obsolete under the SharePoint 2007 OM.
Instead of using SPWebPartCollection you should use Microsoft.SharePoint.WebPartPages.SPLimitedWebPartManager and your project will need a reference to System.Web.
Post a Comment