kamagra how much to take

Getting The Full, Absolute URL Of A ListItem In Office 365

I don't know why Microsoft made it such a pain in the ass to get the url for most of the proxy objects on the SharePoint server object model, but in Office 365 it is even worse. Here is an example of how to get a ListItem actual URL and the modified date of the item. Following I will throw the values into a dictionary.

  1. Dictionary<string, string> urlDict = new Dictionary<string, string>();
  2. foreach (List list in ListsToProcess)
  3. {
  4. ListItemCollection items = list.GetItems(CamlQuery.CreateAllItemsQuery());
  5. list.Context.Load(items);
  6. list.Context.ExecuteQuery();
  7. foreach (SharePointListItem item in items)
  8. {
  9. list.Context.Load(item, x => x["FileRef"], x => x["Modified"]);
  10. string startUrl = list.Context.Url;
  11. list.Context.ExecuteQuery();
  12. string fullUrl = startUrl + item["FileRef"];
  13. string lastModified = item["Modified"].ToString();
  14. if (!urlDict.ContainsKey(fullUrl))
  15. {
  16. urlDict.Add(fullUrl, lastModified);
  17. }
  18. }
  19. }
Share

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>