I have below code to get list items and then I bind that to GridView. List has 2 text columns and a image column. After I bind the datasource to Grid I found Images are not displaying. After debugging I found Image URL return some invalid URLs. Sample returned values for URL:
http://url/Style%20Library/images1.jpg,
http://url/Style%20Library/images2.jpg,
http://url/Style%20Library/images3.jpg,
Images are uploaded to style library and in list image column is Hyperlink or Picture type.
SPListItemCollection collListItems = null;
SPSite site = new SPSite("http://siteURL/");
SPWeb web = site.OpenWeb();
SPList list = web.Lists["Lapptop"];
collListItems = list.Items;
return collListItems.GetDataTable();
Any idea?