Copied to clipboard

Flag this post as spam?

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


  • Dirk 13 posts 33 karma points
    Feb 27, 2012 @ 16:39
    Dirk
    0

    from umbraco.NodeFactory to umbraco.presentation.nodeFactory

    Hello everyone,


    I wrote a user control in .NET 4 with Umbraco 4.7.
    Now I want to deploy this on a server that runs Umbraco 4.5 and .NET 3.5...

    So, I tinkered the project to make it compile in 3.5; apparantly I also needed to switch the namespace "umbraco.NodeFactory" into the old "umbraco.presentation.nodeFacotry".  This finally compiled without problems, but the result is different.

    for example this line:

     s.Append(hotspot.GetProperty("link"));

    Should append the property 'link' of the node 'hotspot' into stringbuilder s, right?
    What it actually returns is this:

    "umbraco.presentation.nodeFactory.Property"
    And that goes for every property I tried to fetch using the GetProperty...

    Does anyone know how I can get it back to work?  Thanks in advance.

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Feb 27, 2012 @ 16:42
    Tom Fulton
    0

    Hi,

    You're correct in that the namespace changed in 4.6 (or 4.7?), if you want to be compatible with 4.5 you'd need to use umbraco.presentation.nodeFactory

    But to get the actual value of a property you should use the .Value property:

    s.Append(hotspot.GetProperty("link").Value);

    You may also want to test for the property itself being null first before you get the Value property.

    HTH,
    Tom

  • Dirk 13 posts 33 karma points
    Feb 27, 2012 @ 17:22
    Dirk
    0

    Allright, that works perfectly.


    Thanks a lot!

Please Sign in or register to post replies

Write your reply to:

Draft