Saturday, 21 July 2012

Create dynamic page1

  public void Createdynamicpage(string title)
        {
            SPWeb spweb = SPContext.Current.Web;

            PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(spweb);


            string pageName = title + ".aspx";

            PageLayout[] pageLayouts = publishingWeb.GetAvailablePageLayouts();

            PageLayout currPageLayout = pageLayouts[9];

            PublishingPageCollection pages = publishingWeb.GetPublishingPages();

            PublishingPage newPage = pages.Add(pageName, currPageLayout);
           
           
            //newPage.ListItem[FieldId.PublishingPageContent] = "This is my content";

            newPage.ListItem.Update();

            newPage.Update();

           // newPage.CheckIn("This is just a comment");

        }

No comments:

Post a Comment

SharePoint online - Get List-item attachments and Display to div

Step 1 : Create a List ex: TestList and attach few images Step 2 : Copy and Pastet the below coding in App.js var  Items =  null ; ...