Copied to clipboard

Flag this post as spam?

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

  • Andreas Iseli 150 posts 427 karma points
    Jun 29, 2014 @ 16:46
    Andreas Iseli

    Using Client Tools in Event Handler

    I'm currently wondering how to properly use the ClientTools (Umbraco.Web.UI.Pages namespace) in event handlers by accessing the UmbracoContext.Current as suggested by the obsolete attribute message.

    Before migration to umbraco 7 I always used the Current Property of the old ClientTools (umbraco.BasePages namespace) which had a legacy fallback.

    I've created my own fallback by using a new BasePage instance:

    ClientTools clientTools = new ClientTools(new BasePage());
    clientTools.MoveNode(content.Id.ToString(CultureInfo.CurrentCulture), monthFolder.Path);

    Is this the way to go or does someone knows it better? My way looks a bit dirty for me... thx :)

Please Sign in or register to post replies

Write your reply to: