I have a web part page (with 3 web parts; 1 webpart is the document library that the web part residing, other 2 is list dispay from the same site) in a document library. The web part page is in the document library.

My task is to copy this web part page and put it in 80 other document libraries (2 of the webparts can stay as it is, 1 webpart refers to document library itself where the web part page is).

I like have it copied programitally. Please let me know if you know a way or have some code (I may need to tweak it a bit). I would truly appreciate it.

1 Answer 1


Unfortunately it would have to be done one site or library at a time if it was done after the fact. If you set this up as a template and then provision the library from the template it would work though.

  • Mike, Thanks for your answer. Are you talking about set up the "Web Part Page" as template (but how? any good link in mind). How do I provision the library. I have recently created stp out of sample doc lib and created bunch of doc libs based on that programatically. However, I have no idea how to do it with "Web Part Pages". All the document libraries has been created. I can recreate the document libraries if that helps. Part 2: How do I provision the library from the template? I feel like you have the right idea. just need little more guidance. Thanks Mike. Truly appreciated.
    – Anonymous
    Aug 27, 2010 at 17:57
  • There are a few key things to understand. 1) When you put a list or library "web part" on a web part page it is actually a reference to a specific list/library and view. Because of that you cannot just copy it around and apply it to other libraries. 2) If you create a list or library definition in code you have the ability to not only generate a list or a library, but execute other code at activation that can provision and link any special items like this web part page with a reference back to a list view. Aug 27, 2010 at 18:25
  • 1. 2 of the webparts will stay the same (with same guid, etc.). 1 of the web part is the doc lib by itself. I think your suggession will help. Mike, do you know what keyword i need to google for this type of issues. Thanks again for your help and being so prompt.
    – Anonymous
    Aug 27, 2010 at 19:51
  • I haven't done it this way, but you can try to query "configuring a web part page programatically" Aug 27, 2010 at 19:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.