1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Create Page Event

Create Page Event

2 posts, 0 answered
  1. Jacques
    Jacques avatar
    427 posts
    Registered:
    28 Jun 2007
    21 Jan 2010
    Link to this post
    Hi Guys,

    On each request for a page we're building an XML document that is used by the Flash component on the site for Navigation purposes. We'd like to cache this XML document to ramp up performance a little, but what we'd also like to do is to 'invalidate' this cache if a new page is created on the site.

    Is there anywhere in Sitefinity that we can track or monitor for a Create Page type of event that will tell us when to invalidate the cache?

    Regards,
    Jacques
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    21 Jan 2010
    Link to this post
    Hi J.Hov,

    Is there anywhere in Sitefinity that we can track or monitor for a Create Page type

    You can subscribe for CmsManager.Executing or Executed event in Global.asax. Then check the command name and manipulate the page

    void Application_Start(object sender, EventArgs e)
        {
         Telerik.Cms.CmsManager.Executed += new EventHandler<Telerik.ExecutedEventArgs>(CmsManager_Executed);
     
    }
     
    void CmsManager_Executed(object sender, Telerik.ExecutedEventArgs e)
        {
            Telerik.Cms.CmsManager manager = new Telerik.Cms.CmsManager();
            switch (e.CommandName)
            {
                case "CreatePage":
                    break;
                case "Publish":
                    break;
                case "PublishNew":
                    break;
                case "DeletePage":
                    break;
     
            }
        }

    If you want to get the page you can call manager.GetPage(e.ItemID);


    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
2 posts, 0 answered