I have list called "Employee" and it has lookup column called as "City". This lookup column is Connected to Picture libraray. I wish to retrieve imageurl from it. How to achieve it. I tried this so far but unable to get.
SPList list = spWeb.Lists["Employee"];
SPList picLibCity = spWeb.Lists["City"];
foreach (SPListItem item in items)
{
EmpList.Add(new EmpLinks
{
Title = item["Title"].ToString(),
City= new SPFieldLookupValue(item["City"] as String).LookupValue
});
}
Then i am trying following to get imageurl
foreach (var row in EmpList)
{
if (row.City!= null)
{
string group = row.city;
SPItem lookupItem = picLibCity.GetItemById(group.LookupId);
string imageUrl = lookupItem["ImageURL"].ToString();
}
}
This is my EmpLinks Class
internal class EmpLinks
{
public string Title { set; get; }
public string City{ set; get; }
}