Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • John Ligtenberg 53 posts 214 karma points
    Feb 20, 2014 @ 11:11
    John Ligtenberg
    0

    Unable to retrieve value of datatype Umbraco.MultipleTextstring

    In Umbraco 7 I've set up a datatype on the property editor Umbraco.MultipleTextstring. This field is supposed to be an array of strings. When I try to retrieve the contents of this field HasValue is true, but the length of the array is zero. I'm unable to retrieve the content through

    @foreach (var item in promotion.listItems)
    {
         <li>@item</li>            
    }
    

    The only way I've been able to retrieve the content so far is by using

    var contentService = ApplicationContext.Current.Services.ContentService;
    var content = contentService.GetById(promotion.Id);
    
    @content.GetValue("listItems")
    

    Can anyone help me out here?

Please Sign in or register to post replies

Write your reply to:

Draft