Get URL Publishing Image in SharePoint 2019

Get URL Publishing Image in SharePoint 2019

There is some changes in order to get the Publishing url from an image, here is my code. This is Server Side Code.

var imagemUrl = item["YourImageFieldName"].ToString().Substring(item["YourImageFieldName"].ToString().IndexOf("src=", StringComparison.Ordinal) + 5,
                                       item["YourImageFieldName"].ToString().IndexOf("style=", StringComparison.Ordinal) - (
                                         item["YourImageFieldName"].ToString().IndexOf("src=", StringComparison.Ordinal) + 7));

Leave a Reply

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

RSS