More in this section

Forums / Developing with Sitefinity / Custom Events on Content Publish

Custom Events on Content Publish

2 posts, 1 answered
  1. Ian Muir
    Ian Muir avatar
    13 posts
    Registered:
    26 Jan 2010
    26 Feb 2010
    Link to this post
    I need to have a block of code run everytime a page is published in the CMS. I've seen a few posts about using LibraryManager_Executing in the global.asax to do this for Library items. Is there an equivalent hook for pages?

    Better yet, is there a documented list of functions we can access in the global.asax in this manner?

  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    26 Feb 2010
    Link to this post
    Hello Ian Muir,

    Thank you for using our services.

    You can use the CmsManager.Executing and CmsManager.Executed event handlers in Global.asax:
    void Application_Start(object sender, EventArgs e)
    {
        // Code that runs on application startup
        Telerik.Cms.CmsManager.Executed += new EventHandler<Telerik.ExecutedEventArgs>(CmsManager_Executed);
        Telerik.Cms.CmsManager.Executing += new EventHandler<Telerik.ExecutingEventArgs>(CmsManager_Executing);
    }
     
    void CmsManager_Executing(object sender, Telerik.ExecutingEventArgs e)
    {
         
    }
     
    void CmsManager_Executed(object sender, Telerik.ExecutedEventArgs e)
    {
        //
    }

    The managers which can be used like this are the CmsManager for pages and managers for generic content based modules: Contentmanager, BlogsManager, NewsManager, EventsManager, LibraryManager.

    Best wishes,
    Radoslav Georgiev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
    Answered
2 posts, 1 answered