Posts

Showing posts with the label Client Object Model

Get sharepoint document library programmatically using Client Object Model :

Image
Get sharepoint document library programmatically using Client Object Model :    Hi here i will explain how to get sharepoint Document Library details using Silverlight. Here i get the document Library details in a C# custom list, and display that details in a combo box. OutPut Screen :  Design Page :  Xaml Code :       Use the following code between User Control    < Grid  x:Name =" LayoutRoot "  Background =" White ">           < Button Content =" Button " x:Name =" btn " Height ="39" Width="64" Click =" btn_Click " Canvas.Left="6" Canvas.Top="96" Margin=" 12,41,1124,619 " />         < ComboBox Height ="38" HorizontalAlignment ="Left" Margin =" 103,42,0,0 " Name =" comboBox1 " VerticalAlignment =" Top " Width=" 568 " />     </ Grid > C# Code : using  System; using  System....

Upload A File To SharePoint Library Using Silverlight (Client Object Model)

Image
HOW TO Upload A File To SharePoint Library Using Silverlight DESIGN PAGE :  Its a simple page, which contains one text box to insert other column details, and one browse button.From button click event we upload the file to sharepoint library USE FOLLOWING CODE TO UPLOAD FILES IN SHARE POINT LIBRARY C# CODE: using  System; using  System.Collections.Generic; using  System.Linq; using  System.Net; using  System.Windows; using  System.Windows.Controls; using  System.Windows.Documents; using  System.Windows.Input; using  System.Windows.Media; using  System.Windows.Media.Animation; using  System.Windows.Shapes; using  Microsoft.SharePoint.Client; using  Microsoft.SharePoint; namespace  FileUpload { public   partial   class   MainPage  :  UserControl { ClientContext  site; List  LibraryName; ListItemCollection _icollListcoll ;     //Load...

How To Insert FieldUser Value in Sharepoint using silverlight(Client object model)

How To Insert FieldUser Value in Sharepoint using silverlight use following code to insert fielduser value in sharepoint C# code: using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using Microsoft.SharePoint.Client; using Microsoft.SharePoint; namespace users { public partial class MainPage : UserControl { string user; GroupCollection G roupcoll; ClientContext site; List listobj; User userna me               //This one is for the field user name     public  MainPage() { InitializeComponent(); site = new ClientContext(ApplicationContext.Current.Url); site.Load(site.Web); listobj = cc.Web.Lists.GetByTitle("your list name"); cc.Load(li...

Add multiple lookup field programmatically sharepoint 2010-client object model

Add multiple lookup field programmatically sharepoint 2010 -client object model Insert the following namespace using Microsoft.SharePoint; using Microsoft.SharePoint.Client; Use the following code.    ClientContext ccsite;    List listobj;    List listobj_lookup;             //Object for lookup list    ListItemCollection _icoll;   public MainPage()       {            InitializeComponent();             ccsite = new ClientContext(ApplicationContext.Current.Url);            ccsite.Load(ccsite.Web);            listobj = ccsite.Web.Lists.GetByTitle( "ListName" );            listobj_lookup= ccsite.Web.Lists.GetByTitle( "ListNa...

sharepoint add lookup field programmatically-client object model

Add lookup field programmatically sharepoint 2010-client object model Insert the following namespace using Microsoft.SharePoint; using Microsoft.SharePoint.Client; Use the following code.    ClientContext ccsite;    List listobj;    List listobj_lookup;             //Object for lookup list    ListItemCollection _icoll;   public MainPage()       {            InitializeComponent();             ccsite = new ClientContext(ApplicationContext.Current.Url);            ccsite.Load(ccsite.Web);            listobj = ccsite.Web.Lists.GetByTitle( "ListName" );            listobj_lookup= ccsite.Web.Lists.GetByTitle( "ListName" );...

Add update and delete list items programmatically in sharepoint-client object model

Add update and delete list items programmatically in sharepoint-client object model: Insert the following namespace using Microsoft.SharePoint; using Microsoft.SharePoint.Client; Use the following code.    ClientContext ccsite;    List listobj;    ListItemCollection _icoll;     public MainPage()         {            InitializeComponent();             ccsite = new ClientContext(ApplicationContext.Current.Url);            ccsite.Load(ccsite.Web);            listobj = ccsite.Web.Lists.GetByTitle( "ListName" );            ccsite.Load(listobj);                   ...