Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ImageFieldValue imageUrl = oListItem["PublishingRollupImage"] as ImageFieldValue;
- if (imageUrl != null)
- {
- item.imageUrl = imageUrl.ImageUrl;
- item.imageWidth = imageUrl.Width.ToString();
- item.imageHeight = imageUrl.Height.ToString();
- }
- ListItem targetListItem = list.GetItemById(8);
- context.Load(targetListItem, item => item["PublishingRollupImage"]);
- context.ExecuteQuery();
- //give value containing img tag
- var imageField = Convert.ToString(targetListItem["PublishingRollupImage"]);
- //Regex to extract the src value from the img tag
- string imageUrl = Regex.Match(imageField, "<img.+?src=["'](.+?)["'].*?>", RegexOptions.IgnoreCase).Groups[1].Value;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement