SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to add a web part on every page of a subsite automatically? Can the web part use the same config as the other pages it is one?

share|improve this question
up vote 1 down vote accepted

With custom code you could iterate over all the (sub)sites and pages and add it programmatic. Some handy work is needed. In this option you can set all the properties you want when adding the webpart to a page. Each page has is own unique config settings.

An other option is to add the webpart to the masterpage. Each page using the edited masterpage would show the webpart. Adding a webpart to a masterpage can be tricky (I haven't done it myself, and I don't know how the settings are stored/set in this scenario).

share|improve this answer
Please note that with 1st approach you have to support automatic addition of the webpart to all newly created pages (item receiver?); with 2nd approach you will lost personalization support of static web parts (they'll behave as web controls) – Ivan Padabed Oct 10 '11 at 13:16
@IvanPadabed Good points! – Dribbel Oct 10 '11 at 13:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.