How to Display the List in Quick Launch Bar in the Sharepoint 2013 using CSOM

Steps
 
Open Visual Studio in your system.
 
Select Console Application template and give as name.
 
Add a Microsoft.Client Assembly reference file in right side reference tab in visual studio.
 
Replace Program.cs with the source code.
  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Linq;  
  4. using System.Text;  
  5. using System.Threading.Tasks;  
  6. using Microsoft.SharePoint.Client;  
  7. namespace CSOMCodeSamples   
  8. {  
  9.     class Program   
  10.     {  
  11.         static void Main(string[] args)   
  12.         {  
  13.             // ClientContext - Get the context for the SharePoint Site    
  14.   
  15.             ClientContext clientContext = new ClientContext("http://gauti.sharepoint.com/sp/");  
  16.             // Get the SharePoint web    
  17.             Web web = clientContext.Web;  
  18.             // Get the SharePoint list by title    
  19.             List list = web.Lists.GetByTitle("NewList");  
  20.             // Display the list in the quick launch bar    
  21.             list.OnQuickLaunch = true;  
  22.             // Update the list    
  23.             list.Update();  
  24.             // Execute the query to the server.    
  25.             clientContext.ExecuteQuery();  
  26.         }  
  27.     }  
  28. }  
Hit F5 and check the output in SharePoint site.
Thanks for reading my blogs.
Ebook Download
View all
Learn
View all