Detecting Edit mode in SharePoint 2010 Team Site RRS feed

  • Question

  • I have found that the following 4 approaches are unable to detect if a team site landing page is in Edit mode:

    1) Using PublishingWebControls:EditModePanel

    2) SPContext.Current.FormContext.FormMode

    3) Using 'WebPartManager wpm = WebPartManager.GetCurrentWebPartManager(Page)' then comparing wpm.DisplayMode to either WebPartManager.EditDisplayMode or WebPartManager.DesignDisplayMode

    4) Looking at the hidden input field 'MSOLayout_InDesignMode' and checking if it has a value of '1' (i.e. Edit mode).

    I have found that the above techniques (particularly option 4) works in most of the other SharePoint site templates, but not in the Team site template. Is this a bug? If not, how do we detect it? I find that calling various JQuery functions (e.g. TypeKit) causes the 'sp.ui.rte.debug.js access denied' issue, which prevents all ribbon dropdown functionality to stop working. So I thought that perhaps if I only call the method in display mode I would be OK. The only other option I have found to fix the 'sp.ui.rte.debug.js access denied issue' is to relax IE browser settings from cross-domain data (see

    Wednesday, January 25, 2012 4:20 AM