Copied to clipboard

Flag this post as spam?

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


  • TempleClause 32 posts 248 karma points
    Feb 09, 2015 @ 01:38
    TempleClause
    0

    Passing parameter values to UserControl (.ascx)

    Hello guys I hope I post this in the correct section.

    So I created a UserControl (.ascx) File and added it as a macro. In the parameter tab I added a new parameter with the type "Multiple Media Picker". How do I access this value in the UserControl? I had no problems accessing a textbox value but I couldn't figure out how to access this kind of type... I assume I need to create a property something like:

    public Umbraco.MultipleMediaPicker images{ get; set; }
    Thanks for the help!
  • TempleClause 32 posts 248 karma points
    Feb 09, 2015 @ 02:05
    TempleClause
    0
            public string images { get; set; }
            ........
            int[] intArray = images.Split(',').Select(n => Convert.ToInt32(n)).ToArray();
            foreach (var item in intArray)
            {
                umbraco.cms.businesslogic.media.Media picMedia = new umbraco.cms.businesslogic.media.Media(item);
                Response.Write("<imgDoNotRenderInForum src=\"" + picMedia.getProperty("umbracoFile").Value + "\" />");
            }
    

    But I get a warning:

    'umbraco.cms.businesslogic.media.Media' is obsolete: 'Obsolete, Use Umbraco.Core.Models.Media'
    

    Maybe there is a nicer way of doing this?

    Thanks

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Feb 09, 2015 @ 05:22
    Jan Skovgaard
    0

    Hi TempleClause and welcome to our :)

    What exact version of Umbraco are you using?

    /Jan

  • TempleClause 32 posts 248 karma points
    Feb 09, 2015 @ 12:39
    TempleClause
    0

    Umbraco version 7.2.1 assembly: 1.0.5462.37503

    thanks

  • TempleClause 32 posts 248 karma points
    Feb 17, 2015 @ 08:17
    TempleClause
    0

    bump :-)

Please Sign in or register to post replies

Write your reply to:

Draft