Copied to clipboard

Flag this post as spam?

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


  • Rasmus Fjord 659 posts 1546 karma points c-trib
    May 24, 2012 @ 14:21
    Rasmus Fjord
    0

    ClientTools.SyncTree throws "object reference not set to an instance....." help

    Hey there :)

    Im building a custom datatype for a customer at the moment and im in need to refresh the media tree structure. Ive read that i should use the "synctree" in the clienttools.

    In my custom datatype project i make some ajax requests to /base service. and inside this function im executing a

       BasePage.Current.ClientTools.SyncTree(selected.Path, true).ShowSpeechBubble(BasePage.speechBubbleIcon.success, "Saved", "Changes has been saved");

    But its just giving me "Object reference not set to an instance of an object."

    Anyone who can help ?

     

  • xrisdoc 54 posts 102 karma points
    Feb 06, 2013 @ 16:45
    xrisdoc
    100

    Hello,

    I see this was posted a while back.

    I too encountered this issue and came accross this post when trying to investigate the issue and as there were no replies I though I would reply with what I did to fix this. 

    All I had to do to fix this, was to inherit my page class from umbraco.BasePages.UmbracoEnsuredPage. Example provided below:

    public partial class MyUmbracoPage : umbraco.BasePages.UmbracoEnsuredPage

    Hope this helps.

    Thanks,

    Chris

  • Rasmus Fjord 659 posts 1546 karma points c-trib
    Feb 07, 2013 @ 10:54
    Rasmus Fjord
    0

    Awesome thx :) 

    I will throw you a green check marker and remember it for next time.

  • Ben McKean 260 posts 515 karma points
    Mar 28, 2013 @ 13:17
    Ben McKean
    0

    I'm trying to do this in an event. Has anybody had any joy with it that way?

    The events inherit from ApplicationBase so can't use UmbracoEnsurePage

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies