Copied to clipboard

Flag this post as spam?

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


  • Lee See Raa 6 posts 96 karma points
    May 23, 2018 @ 04:53
    Lee See Raa
    0

    Umbraco 7.10.2 Error Media Picker

    <img src="@(partner.GetValue<IPublishedContent>("manageMedia").Url)" alt="img" />
    

    CS0103

    The name *'partner'* does not exist in the current context  
    
  • Søren Mastrup 122 posts 564 karma points c-trib
    May 23, 2018 @ 05:40
    Søren Mastrup
    0

    Hi,

    partner looks to be a variable? Is it a content node? If you are using models builder, and partner is a property on a doctype, you could simply do Model.Content.Partner.Url

  • Lee See Raa 6 posts 96 karma points
    May 23, 2018 @ 06:43
    Lee See Raa
    0

    when I try Model.Content.Partner.Url

    CS1061 'IPublishedContent' does not contain a definition for 'Partner' and no extension method 'Partner' accepting a first argument of type 'IPublishedContent' could be found (are you missing a using directive or an assembly reference?)

  • Lee See Raa 6 posts 96 karma points
    May 23, 2018 @ 06:56
    Lee See Raa
    100

    When I try to this. And fix my Issue

    @{
    var listImage = Model.Content.GetPropertyValue<IEnumerable<Umbraco.Core.Models.IPublishedContent>>("manageMedia");
    }
    
    @foreach (var item in listImage)
    {
        <img [email protected] alt="img" />
    }
    
Please Sign in or register to post replies

Write your reply to:

Draft