Copied to clipboard

Flag this post as spam?

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


  • Tom 713 posts 954 karma points
    Mar 17, 2011 @ 01:45
    Tom
    0

    Equivalent of umbraco:Item in cs

    Hi all I have an instance where i need to set the title attribute of an image with a page value in a usercontrol macro i.e.

    <img src="blah.jpg" title="<umbraco:item field="imageTitleBlah" runat="server"/>"/>

    should i just pass it in to the user control macro as a property or is there a better way of doing it in the usercontrols cs file?

  • Harald Ulriksen 207 posts 249 karma points
    Mar 17, 2011 @ 08:35
    Harald Ulriksen
    2

    Hi,

    you can set this from codebehind. Access the node through umbraco.presentation.nodeFactory.Node.GetCurrent() - Change the image to an asp.net image and set the title attribute using the GetProperty method on the node.

    Cheers,
    Harald

Please Sign in or register to post replies

Write your reply to:

Draft