About SharePoint's client object model when load and execut query a point of their own view

Source: Internet
Author: User

Many people in the use of the client object model, do not know when or should not load, today see an idea to describe the problem, feel very reasonable, and share with you. That is, writing the client object model is like writing a SQL statement. You can use complex query statements at will, and when you want to see the results, execute the SQL statement. There is no question of code efficiency, which is another topic.

The meaning of the client object model is the same, you can use the object as well as the object's properties to build the object you want, but when you want to use the result object or want to see the results, it is time for you to load.

A typical example:

1. When you want to query the Web title, at the level of the web you have to load.

web = context.web;

Context.load (web, ' Title ');

Context.executquery ();

Web. The title can be obtained.

2. When you want to query the item, the web is not load, even the list does not load, you just need to build ListItemCollection object, and then load the ListItemCollection object

List = Context.web.get_lists (). Getbytitle (' ASD ')

Olistitems = Orglist.getitems (camlquery);

Context.load (Olistitems);

Just a little bit of my personal opinion.

About SharePoint's client object model when load and execut query a point of their own view

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.