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 template in use and a webpage. If a user wants to create a new project, the user should click on a link/button. This would generate around 36 new pages, all with links to each other. Also, the links should automatically be added to the list of projects on the previous level.

Is this possible? How do I go about doing it?

Thanks

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

How about creating a visual web part with a button? Then in the Button.Click event you would provision each of these pages. The tutorial I used to make my first web part is found here: http://blog.concurrency.com/sharepoint/create-a-custom-web-part-for-sharepoint-2010/

As far as links to each other, you could use relative links if they are always provisioned in the same structure.

You can add the link to the project landing page to the top navigation of the root site programmatically as well. Check out this code sample:

// -- Add to Quick Launch --
Navigation.SPNavigationNode nodeChild =
    new Navigation.SPNavigationNode(web.Title, strUrl);
web.ParentWeb.Navigation.TopNavigationBar.AddAsLast(nodeChild);

Navigation.SPNavigationNodeCollection ncQuickLaunch =
    web.ParentWeb.Navigation.QuickLaunch;
foreach (Navigation.SPNavigationNode node in ncQuickLaunch)
{
    if (node.Title == "Sites")
    {
        node.Children.AddAsLast(nodeChild);
        break;
    }
}
share|improve this answer
    
thanks for your reply. I only just saw this comment. This seems like it should work, but I will try this method out and get back with the results. –  Guwanjith Aug 2 '12 at 16:31
    
Awesome. Sounds good. I know this worked for me (pulled it from a project). –  RJ Cuthbertson Aug 2 '12 at 16:38
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.