SharePoint2010 Sliverlight Client OM

SharePoint2010  Sliverlight List Web Part Using Client Object Model.

Please read more about my earlier post related to name as “ SharePoint2010 Client Model With Example” describe the different-2 ways of fetching the data using SharePoint 2010 Client OM.
Open Visual Studio 2010 Create a new project under SliverLight project category. Give it name let say ex “SilverLightListWebPart”

Paste the following code in MainPage.xaml

<UserControl x:Class="SilverLightListWebPart.MainPage"
    d:DesignHeight="300" d:DesignWidth="400">

    <Grid x:Name="LayoutRoot" Background="White">
        <ListBox Name="listbox1" Width="200" Height="400"   HorizontalAlignment="Left"  Margin="0,0,0,0" VerticalAlignment="Top"/>


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;

namespace SilverLightListWebPart
    public partial class MainPage : UserControl
        IEnumerable<List> _genericList;
        public MainPage()
            var ctx = ClientContext.Current;
            _genericList = ctx.LoadQuery(ctx.Web.Lists.Include
                (l => l.Title).Where(l => l.BaseType == BaseType.GenericList));
            ctx.ExecuteQueryAsync(Pass, fail);
        // in case of Request pass
        public void Pass(object sender, ClientRequestSucceededEventArgs args)
            // Thread BEGIN
        // in case of Request fail
        public void fail(object sender, ClientRequestFailedEventArgs args)


        public void Bindlist()
            listbox1.ItemsSource = _genericList;
            listbox1.DisplayMemberPath = "Title";


Popular posts from this blog

SharePoint RPC Protocols Examples Using OWSSVR.DLL

STS CryptographicException Error : Key set does not exist

Query suggestions in SP 2013 Using Rest API (/_api/search/suggest)