Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

CSOM get content type by name - javascript vs. C#

$
0
0

When trying to find a content type by name using CSOM in C#, I can avoid requesting all contenttypes and filtering client side:

var cts = web.ContentTypes;
ctx.Load(cts, c => c.Where(w => w.Name == 'content_type_name'));

When executing the query, the filter gets sent to the server and only the actual hit is returned over the network - nice so far.

Now, I'd like to do the same thing in javascript insted of c#; however, I can't seem to find a way to specify a similar filter in javascript. is this just not possible or am I missing something. 



Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>