References
using Microsoft.SharePoint.Client;
using Microsoft.SharePoint;
using SP = Microsoft.SharePoint.Client;
Implementation
// Starting with ClientContext, the constructor requires a URL to the server running SharePoint.
ClientContext context2010 = new ClientContext("SharePoint URL");
WebCreationInformation creation = new WebCreationInformation();
creation.Url = "New web URL name";
creation.Title = "New web title";
Web newWeb = context2010.Web.Webs.Add(creation);
// Retrieve the new web information.
context2010.Load(newWeb, w => w.Title);
context2010.ExecuteQuery();
MessageBox.Show("Web created");
using Microsoft.SharePoint.Client;
using Microsoft.SharePoint;
using SP = Microsoft.SharePoint.Client;
// Starting with ClientContext, the constructor requires a URL to the server running SharePoint.
ClientContext context2010 = new ClientContext("SharePoint URL");
WebCreationInformation creation = new WebCreationInformation();
creation.Url = "New web URL name";
creation.Title = "New web title";
Web newWeb = context2010.Web.Webs.Add(creation);
// Retrieve the new web information.
context2010.Load(newWeb, w => w.Title);
context2010.ExecuteQuery();
MessageBox.Show("Web created");
No comments:
Post a Comment