Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a requirement where I need to create a new document/library or a new document library view associated with the page when I create a document library page using a custom page layout.

I'm using sharepoint 2010.

Thanks, Lav

share|improve this question
    
What have you tried so far? –  Russell Dec 21 '11 at 5:08
    
I was thinking of using a workflow to be associated with create page button. Being a newbee in sharepoint I'd seriously appreciate some help. :) –  Lav Dec 21 '11 at 5:12
    
ok. :) You will need to use custom code to create an event receiver in Visual Studio. After you have finished coding, you can deploy the package (WSP) using Visual Studio or deploy it using PowerShell. –  Russell Dec 21 '11 at 5:16
    
what do you mean by automatically associate? –  Muhammedh Dec 21 '11 at 5:51
add comment

1 Answer

You need to create an event receiver to listen for when a page has been created. You attach the event receiver to the Pages library. You can use the server object model to create a document or library.

See these links:

Creating an event receiver:

Creating a document library using the Server OM:

share|improve this answer
    
thanks for the help russel.. much appreciated! :) –  Lav Dec 21 '11 at 5:30
    
You're welcome. :) Glad to help! If it answers your question, feel free to mark as answer. –  Russell Dec 21 '11 at 5:32
    
Any clue on how to automatically associate the created library with the page that I'll create? –  Lav Dec 21 '11 at 5:33
    
You could add a column "Library Name" in the Pages library which is updated when you create the new library. –  Russell Dec 21 '11 at 5:39
add comment

Your Answer

 
discard

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.