Hi @Modus Dev
Please check the value of templateType
and OMDALConstants.Ask
. Per my test, I can successfully create a subsite by following code
WebCreationInformation oWebCreationInformation = new WebCreationInformation();
// This is relative URL of the url provided in context
oWebCreationInformation.Url = "NewSubSite";
oWebCreationInformation.Title = "NewSubSite Site";
oWebCreationInformation.Description = "NewSubSite description";
// This will inherit permission from parent site
oWebCreationInformation.UseSamePermissionsAsParentSite = true;
// "STS#0" is the code for 'Team Site' template
oWebCreationInformation.WebTemplate = "STS#0";
oWebCreationInformation.Language = 1033;
Web oWeb = clientContext.Site.RootWeb.Webs.Add(oWebCreationInformation);
clientContext.ExecuteQuery();
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.