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

Background: (tool used Sharepoint designer 2007) 1. I created a aspx page (using UI) that is inside a document library (content type is web part pages and a custom content type). 2. I then added 3 web parts (2 simple list. 1 current document library list) to this page


  1. Now I need the same aspx page with 3 webparts for all the other document libraries I have on the same sub site.
  2. I need to create 100+ same aspx pages for 100+ document libraries.
  3. The aspx pages are named after the document libraries. For example, TestDocLib document library will have TestDocLib.aspx in it. (I have a text file with all the document libraries names)


  1. Do I need to create a console app for this? or feature ... I really need some suggestions.
share|improve this question

You could easily turn this into a feature with a Module. Add each web part page into a File element and your Web Parts into a AllUsersWebPart element and then activate the feature on your web sites, like this:

<File Path="default.aspx" Url="Documents/default.aspx" 
   Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE">
  <AllUsersWebPart WebPartZoneID="Main" WebPartOrder="0" ID="WebPart1">
        <webPart xmlns="">
        <type name="**Full class/assembly name**" />
        <importErrorMessage>Cannot import this Web Part.
        <property name="Title" type="string">The title</property>
share|improve this answer

First of all is the parent site a Collaboration or Publishing site? Because there are different options available to you if it is a publishing site.

If the parent site is just a standard Team Site then you could do something like this to programmatically create a page in a document library -


Then once you have created the page you can get a reference the SPWebPartManager class to add the web parts to the page.

I would suggest either doing this in a console app or perhaps a custom SharePoint timer job that you can execute manually.

Hope this helps,



share|improve this answer

Your Answer


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