SaaS CMS has officially launched! Learn more now.

Detect when the Edit tab in Edit Mode is clicked



I've spent several days searching for a way to detect when the Edit tab (in Edit Mode) is selected. I know that DataFactory contains several methods for catching events, but it doesn't include one for an Edit tab-clicked event.

Is there any way to catch this event and attach an event handler to it?


Aug 16, 2011 13:32

What are you looking to ahieve? Is it down at the API level or something in the EPiServer UI?

Aug 16, 2011 19:08

I'm making a plugin which, without going into too much detail, should get the name of the editor and the current page id whenever the Edit tab is clicked. It would be preferable if this could be achieved through the API, but other solutions are welcome as well.

Aug 17, 2011 8:37

Hello William

You can use the plug in architecture to hook into the edit panel itself (via the LoadComplete event). This fires when the edit panel is being set up so you can get the page ID and editor name here:

[GuiPlugIn(Area = PlugInArea.EditPanel)]
public class EditPanelHook : ICustomPlugInLoader
    public PlugInDescriptor[] List()
        // hook LoadComplete-event on EditPanel page
        EditPanel editPanel = HttpContext.Current.Handler as EditPanel;

        if (null != editPanel)
            editPanel.LoadComplete += new EventHandler(editPanel_LoadComplete);

        //Never return a plugin - we don't want to add tabs.
        return new PlugInDescriptor[0] { };

    protected void editPanel_LoadComplete(object sender, EventArgs e)
        //Code to grab the user and page ID here





Aug 17, 2011 13:17

Thanks! The code works perfectly, had no idea it was so simple :)

Aug 17, 2011 13:31
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.