Copied to clipboard

Flag this post as spam?

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


  • Rachel Skuse 88 posts 118 karma points
    Mar 11, 2010 @ 14:46
    Rachel Skuse
    0

    Trying to get an Image Path of a variable specified in a usercontrol

    I have a usercontrol which displays colour swatches depending on whether or not the colour has been selected using a true/false datatype.
    A colour is actually an ImageButton and when I click the button I need an Image to change to reflect the color.

    I am using a switch statement (because there is potentially more than one colour)

    ImageButton img = (ImageButton)sender;
    string prodImgToDisplay = string.Empty;
    switch (img.ID)
        {
            case "imgBtnColGlossBlack":
            this.ltlColorImage.Text = prodImgBlack;
            break;
        }

    and this is working fine when I run it in Visual Studio.

    My problem is, getting the path of the image into the variable prodImgBlack. I have tried the following but it still only returns the image id.

    <umbraco:Macro field="umbracoFile" nodeid="[#prodImgBlack] prodImgBlack="[#prodImgBlack]" Alias="ProductImages" runat="server"></umbraco:Macro>

    In my full code I will be specifying more than one image parameter in the macro. Is anyone able to help me out?!

    Thanks,

    Rachel

     

Please Sign in or register to post replies

Write your reply to:

Draft