Copied to clipboard

Flag this post as spam?

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


  • Damiano 9 posts 30 karma points
    Sep 01, 2010 @ 17:27
    Damiano
    0

    Reload tree node on Media deleting

    I've created a custom section where I load Media objects and show their details (similar to Media section).

    On deleting event (Media_AfterDelete) I fail to refresh the nodes tree.

    I tried with:

    Media.AfterDelete += new Media.DeleteEventHandler(Media_AfterDelete);

     

    void Media_AfterDelete(Media sender, umbraco.cms.businesslogic.DeleteEventArgs e)
            {

     

         Document obj = new Document(sender.Id);
                  ((BasePage)obj.HttpContext.CurrentHandler).reloadParentNode();

     

       }

    but it doesn't work.

    (Document cast is a trick to call reloadParentNode(), it works for New and Move events)

    How can I call the refresh/reload function for the Media nodes tree

     

  • adam 4 posts 25 karma points
    Oct 15, 2010 @ 16:08
    adam
    0

    hi, not sure whether this will work for you but following logic from video tutorials (umbraco.tv) on building new section by Tim I created method        

    public bool Save()
            {
                return true;
            }

    and I call it when I need instant page refresh. Works for me on aspx pages but not on ascx user controls.

    Hope it helps.

Please Sign in or register to post replies

Write your reply to:

Draft