Server Object Model – Sample Codes

I have created a Windows Forms Application to demonstrate the sample codes for Server Object Model using C# coding. Please include Microsoft.SharePoint and Microsoft.SharePoint.Administration DLLs in the project. These are available at “C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI” folder. You can make changes to the form as per your requirement.

Sample Codes

Read Site Collection’s Title and Description.
You can access various properties of a Web. Below is a sample code:

public void getWebTitleDesc(string siteURL)
{
       using(SPSite site=new SPSite(siteURL))
       {
           using(SPWeb web=site.OpenWeb())
           {
               textBox1.Text = web.Title;
               textBox2.Text = web.Description;
           }
       }
}

Continue reading “Server Object Model – Sample Codes”

Power Platform Academy

Start or Upgrade your Career with Power Platform

Learn with Akanksha

Python | Azure | AI/ML | OpenAI | MLOps

Design a site like this with WordPress.com
Get started