none
Create a site using custom template in sharepoint 2013 using csom RRS feed

  • Question

  • How to create a sub site using custom template in sharepoint 2013 using csom? Is it possible to do? becuase we are creating a site using csom.
    • Edited by Sharu_14 Thursday, March 9, 2017 7:27 AM
    Thursday, March 9, 2017 6:13 AM

All replies

  • Here you go

    https://social.technet.microsoft.com/Forums/office/en-US/78f4db59-85db-4576-83f0-91ef01195547/is-it-possible-to-create-site-collection-with-custom-template-selectlater-using-csom?forum=sharepointdevelopment


    Please remember to click Mark as Answer on the answer if it helps you

    Thursday, March 9, 2017 6:39 AM
  • Try this

    http://blog.scoreman.net/2013/02/create-site-collections-in-sharepoint-online-using-csom/

    This link is applicable for share point online.


    • Edited by sk2014 Thursday, March 9, 2017 6:52 AM
    Thursday, March 9, 2017 6:50 AM
  • http://yeshagrawal.blogspot.in/2013/06/sharepoint-2013-create-site-from-custom.html
    Thursday, March 9, 2017 6:53 AM
  • Hi , 

    In here, they are using JSOM to create a site with custom template. But i need to create a site with custom template using CSOM. 

    Thursday, March 9, 2017 9:04 AM
  • Hi,

    Here is the sample code for your reference.

    using (var context = new ClientContext("http://sp:12001"))
                {
                    Console.ForegroundColor = ConsoleColor.Green;
                    WebCreationInformation child = new WebCreationInformation();
                    child.WebTemplate = "STS#0";//"{516EB07D-8711-4B9F-A3AD-097B28C5CDDF}#MyCustomTemplate";
                    child.Description = "MyNewSubSite";
                    child.Title = "MyNewSubSite";
                    child.Url = "MyNewSubSite";
                    child.Language = 1033;
                    context.Web.Webs.Add(child);
                    context.ExecuteQuery();      
                    Console.WriteLine("Done");
                    Console.ReadKey();
                }

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, March 13, 2017 8:30 AM