Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

If this is for Client so the Client does not need to have SharePoint installed on its computer to get it work? am I right?

I need some information to understand it, the code executed on client side so why he needs to have Sharepoint?

share|improve this question

2 Answers 2

When using the Silverlight Client Object Model you have two way of getting a valid ClientContext.

Either you specify the url of the SharePoint site to work with in the constructor to a ClientContext like this:

ClientContext clientContext = new ClientContext("http://sharepoint");

Or the <object> tag used to load your SilverLight application should contain a <param> tag with name "initParams" and a value MS.SP.url = url. So you could use something like:

<param name="initParams" value="MS.SP.url=<%= Microsoft.SharePoint.Utilities.SPHttpUtility.HtmlEncode(Microsoft.SharePoint.SPContext.Current.Web.Url) %>" />

to specify it. The OOTB Silverlight web part does this. Then you can use ClientContext.Current.

share|improve this answer

Client Object Model in SharePoint has basically 3 applications, nore requiring SP installed, but for which one you need certain libraries available during development: 1. ECMA Client OM - to be used by Javascript - no SharePoint whatsoever but you need the libraries (SP.js, etc.) 2. Managed - For use from Windows Forms, Console Applications, etc. - in this one you need the Managed SharePoint assemblies 3. Silverlight Client OM - Same as #2 but you need to also link to some Microsoft.SharePoint.Client.Silverlight and Microsoft.SharePoint.Client.Silverlight.Runtime

For more read here http://praveenbattula.blogspot.com/2010/02/sharepoint-2010-complete-details-about.html

Hope this helps, C:\Marius

share|improve this answer
    
Thanks, I have downloaded libraries that I needed, Microsoft.SharePoint.Client.Silverlight and Microsoft.SharePoint.Client.Silverlight.Runtime so as you said I dont need to have SharePoint installed, but when I run my code Context is null –  Medes Apr 22 '12 at 17:55
    
Actually you need to "connect" to the SharePoint site collection prior to using the client context. We normally use the initParams to pass parameters to either your web part/component. See this link from blah.winsmarts.com/… –  C. Marius - MVP Apr 22 '12 at 19:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.