.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Client Object Model - Web.MapToIcon

Posted By:      Posted Date: October 14, 2010    Points: 0   Category :SharePoint


The Web.MapToIcon method is always rertuning null in the Client Object Model. I've tried many things, but none of them are working:

list.ParentWeb.MapToIcon(listItem.File.ServerRelativeUrl, string.Empty,Microsoft.SharePoint.Client.Utilities.IconSize.Size16)

list.ParentWeb.MapToIcon(listItem.File.Name, string.Empty,Microsoft.SharePoint.Client.Utilities.IconSize.Size16)

list.ParentWeb.MapToIcon(".docx", string.Empty,Microsoft.SharePoint.Client.Utilities.IconSize.Size16)

list.ParentWeb.MapToIcon("test.docx", string.Empty,Microsoft.SharePoint.Client.Utilities.IconSize.Size16)


Anyone who can help me with this? If I test this with the Microsoft.SharePoint.Utilities.SPUtility.MapToIcon method (Server Object Model), it works fine..



View Complete Post

More Related Resource Links

Client Object Model Resource Center | SharePoint 2010

Are you creating client applications that access SharePoint data remotely? Find overviews, guidelines, and programming tasks for all three flavors of the SharePoint Foundation client object model: .NET managed, Silverlight, and ECMAScript.

Quick Note: Building WPF Applications by Using the SharePoint 2010 Client Object Model

Learn how to create a Windows Presentation Foundation (WPF) application that uses the SharePoint 2010 client object model to retrieve data from a SharePoint Web site.

Using the SharePoint Foundation 2010 Managed Client Object Model with the Open XML SDK 2.0

Write client-side applications that work with Open XML documents that are stored in document libraries by using these two technologies together.

Using the SharePoint Foundation 2010 Managed Client Object Model

Write applications that are based on the .NET Framework and access SharePoint content from clients without installing code on the server that runs SharePoint Foundation 2010.

Video: Overview of the SharePoint 2010 Client Object Model

In SharePoint 2010 there are a number of object models that can be used by developers to access the server. For example, the Client Object Model (Client OM) can be accessed via Web services, via a client (JavaScript) API, and via REST. (Length: 12:22)

Video: SharePoint 2010: Silverlight Client Object Model

In this video you will learn how to use the SharePoint client object model to program a Silverlight application against SharePoint data. (Length: 9:03)

Video: SharePoint 2010: ECMAScript Client Object Model

In this video you will learn how to use the SharePoint client object model to program a ECMAScript application against SharePoint data. (Length: 8:20)

Video: Developing .NET Applications by Using the SharePoint 2010 Client Object Model

This demonstration shows how to use the client object model from a console application. (Length: 8:47)

Video: Developing Silverlight Applications by Using the SharePoint 2010 Client Object Model

This demonstration shows how to use the client object model from a Silverlight application. (Length: 11:15)

Video: SharePoint 2010 Data and the Client Object Model

This video provides an overview of how to use the client object model from a Windows Presentation Foundation application. (Length: 5:38)

Client Object Model - cannot retrive "Modified By" field value

Hi, I am using Client Object Model to get all items from a list and display theme with "Modified By" information. Everything works nice until I start using test users. I have noticed that for user who is in Domain Admins group i have no problem for others I cannot read "modiefied by" field value. var context = ClientContext.Current; activitySPList = context.Site.RootWeb.Lists.GetByTitle("Activities") activityItems = activitySPList.GetItems(CamlQuery.CreateAllItemsQuery()); context.Load(activityItems); context.ExecuteQueryAsync( ClientRequestSucceeded, ClientRequestFailed ); All items in activityItems collection doesn't have "Modified By" fields. Do you know why and how to fix it? Thanks for your help.

SP2010 Client Object Model: How to cast Field to FieldCalculated

Hello, I need to modify formula for existing field and can't do it because this code raise exception - (Cannot cast 'fld' (which has an actual type of 'Microsoft.SharePoint.Client.Field') to 'Microsoft.SharePoint.Client.FieldCalculated').   using (var clientContext = new ClientContext(@"http://Server")) { var web = clientContext.Web; var lst = web.Lists.GetByTitle("MyList"); <strong>var fld = (FieldCalculated)lst.Fields.GetByInternalNameOrTitle("Formula1");</strong> clientContext.Load(fld); clientContext.ExecuteQuery(); }   I can't use fld.SchemaXml modification by some reason. May be you can help me? Thank you.

Client object model Authentication.

  Sorry for my bad english. With WPF, I can get authentication using below code             ClientContext clientContext = new ClientContext("URL");             clientContext.AuthenticationMode = ClientAuthenticationMode.Default;             NetworkCredential credential = new NetworkCredential("ID", "PASSWORD", "URL");             clientContext.Credentials = credential; But with silverlight, I can't find AuthenticationMode property with ClientContext.   I want to get authentication using client object model with silverlight. Can anybody help me?   thanks!!   

View Definition for SP 2010 Client Object Model

Hello, I am looking for where in the SP Client Object Model that I would find where the View Definitions are Located. For various reasons, I am displaying in my own custom listview a list of Documents and I would like these list results to share the same look as if the user was looking at the list in SharePoint.Please note this is NOT web based, but an application. Can someone give me a hint as to how to pull a view definition? Thanks, Andrew

Client Object Model - update metadata

Is there a way that I can update the metadata for a document in a document list using a UniqueId without having to speciify the library name? If I know the library name and the ID I know how to update the metadata but what I was hoping was that there would be a way of doing it using a UniqueId without knowing exactly which Library the document is in.

How to get List ContentTypes using ECMAScript Client Object Model?

Hello SharePoint Experts, I have a document library in SP 2010 site which also has a custom Ribbon button. The user can select either a folder or a document/List Item from the document library. I want to disable the custom Ribbon button if the user selects the folder and enable it when the user selects document/List Item. I want to do all this using JavaScript/ECMAScript Client Object Model. I tried many things,but could not do it yet. I know I how to check if the currently selected item has a Folder ContentType or an Item ContentType. Code: var _clientContext = new SP.ClientContext.get_current(); var _web = _clientContext.get_web(); var _list = _web.get_lists().getById(SP.ListOperation.Selection.getSelectedList());                                  _clientContext.load(_list, 'Title', 'Id'); _clientContext.executeQueryAsync(Function.createDelegate(this, onListLoaded), Function.createDelegate(this, onListFailed)); function onListLoaded(sender, args) {                                   alert('onListLoaded...');        &n

Client Object Model

              var ctx = new SP.ClientContext.get_current();             var web = ctx.get_web();             ctx.load(web);               ctx.executeQueryAsync();
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend