Skip to content

Web operations

Albert Moravec edited this page Mar 15, 2018 · 2 revisions

Load webs

Loads all sub-webs of currently selected web

op.LoadWebs()
  .Execute();

Load web

This also sets loaded web as the one to operate on

op.LoadWeb("Dashboard")
  .Execute();

Select web

op.SelectWeb("Dashboard"); // Now you can operate on the selected web

Add web

// Default template
op.CreateWeb("Customers", "customers") // URL is relative to current web
  .Execute();

// Using custom template
op.CreateWeb("Customers", "customers", "CustomersTemplate")
  .Execute();

Delete web

op.SelectWeb("Customers")
  .DeleteWeb()
  .Execute();

Create list

// Using predefined templates
op.CreateList("Documents", ListTemplate.DocumentLibrary)
  .Execute();

// Using custom template name
op.CreateList("Tasks", "Custom tasks")
  .Execute();

Delete list

op.DeleteList("List #1")
  .Execute();
Clone this wiki locally