SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a SPList Item with GUID of "212E3462-B24C-4F84-8CA0-3A703C492B8E". This is news item which has some images with thumbnails. I have multiple zones enabled for my site with AAM. I am trying to get the Thumbnail URLs for different zones. I am always getting only one default site domain name in the Thumbnail URL. Here is the code snippet. Please let me know what is the problem with my code.

        public NewsItem(SPListItem item)
        // Get item details
        this.Title = item[SPBuiltInFieldId.Title].ToString();
        this.StartDate = (DateTime)item[new Guid(Fields.StartDateFieldId)];
        this.EndDate = (DateTime)item[new Guid(Fields.EndDateFieldId)];
        this.ContentType = item.ContentType.Name;
        this.Headline = item[new Guid(Fields.HeadlineFieldId)].ToString();
        this.NewsBody = item[new Guid(Fields.MainBody)].ToString();
        this.Location = SPHelper.GetTaxonomyFieldValue(item, new Guid(Fields.Location), ", ");
        this.CategoryList = SPHelper.GetTaxonomyFieldValuesList(item, new Guid(Fields.NewsCategory));
        this.TagList = SPHelper.GetTaxonomyFieldValuesList(item, new Guid(Fields.Tags));
        this.Type = item.ContentTypeId.ToString().StartsWith(ContentTypes.NewsBase_ID, StringComparison.CurrentCultureIgnoreCase) ? NewsType.News : NewsType.Events;
        Logger logger = CustomLogManager.GetCurrentClassLogger();
        // Construct the URLs needed
        this.MoreUrl = string.Format("{0}{1}?lstId={2}&itmId={3}&m={4}&y={5}&ct={6}",
                                ((Type == NewsType.News) ? PageConstants.NewsDetailPage_Url : PageConstants.EventDetailPage_Url),
        this.ArchiveBrowserUrl = string.Format("{0}{1}?m={2}&y={3}&ct={4}",                                    
                                ((Type == NewsType.News) ? PageConstants.NewsTimelinePage_Url : PageConstants.EventsTimelinePage_Url),
        // Get the image - if missing get 'no image'
        if (item[new Guid(Fields.ThumbnailFieldId)] != null)
            SPFieldUrlValue thumbnail = new SPFieldUrlValue(item[new Guid(Fields.ThumbnailFieldId)].ToString());
            this.ThumbnailUrl = thumbnail.Url;
            logger.Info("Guid - " + Fields.ThumbnailFieldId);
            logger.Info(" this.ThumbnailUrl - " + this.ThumbnailUrl);
            this.ThumbnailUrl = SPUtility.ConcatUrls(item.ParentList.ParentWeb.ServerRelativeUrl, CommonConstants.Default_Img_Url);                
share|improve this question
Could some one help me wiht this please? – Ram Apr 3 '13 at 8:53

Take a look here:

SPFieldUrlValue from codebehind results in URL's in default zone.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.