none
Load() method in Client Side Object Model (CSOM) RRS feed

  • Question

  • Hi,

                    ClientContext ctx = new ClientContext("https://MySharePointSiteUrl")

                    Web myweb = ctx.Web;
                    List lst = myweb.Lists.GetByTitle("HR Announcements");

                    ListItemCreationInformation Iteminfo = new  ListItemCreationInformation();
                    ListItem item = lst.AddItem(Iteminfo);
                    item["Title"] = "first item from code";

                    item.Update();

                    ctx.ExecuteQuery();

    The above code is working fine, and I have read many articles on internet, all of them say that I should use Load() method to enable access to any SharePoint object like Web or List.

    So, when should or shouldn't I use Load() method???

    Thanks in Advance

    Abdelfattah Hussein.

    Thursday, April 20, 2017 12:04 PM

All replies