sitecoresitecore8.1sitecore8.2

Sitecore 8.2 showing error attempt to access method 'Sitecore.Context+PageMode.get_IsPageEditor()' failed


I have upgraded from Sitecore 8.1 to Sitecore 8.2. I have a method in which I am using:

Sitecore.Context.PageMode.IsPageEditor 

For this it is giving error:

attempt by method METHOD_NAME to access method 'Sitecore.Context+PageMode.get_IsPageEditor()' failed.

What am I missing?


Solution

  • The

    Sitecore.Context.PageMode.IsPageEditor

    Is deprecated in the Sitecore.Kernel since Sitecore 8.0 Update-6 see the release notes:

    Deprecated and removed functionality

    The properties IsPageEditor, IsPageEditorDesigning and IsPageEditorEditing in the class Context.PageMode from Sitecore namespace have been deprecated in favor of the new introduced properties IsExperienceEditor and IsExperienceEditorEditing. Old properties will be removed in one of the future major versions. (438475)

    In Sitecore 8.2 update 1 the Sitecore.Context.PageMode.IsPageEditor is removed use

    Sitecore.Context.PageMode.IsExperienceEditor

    Same for:

    IsPageEditor, Obsolete Use IsExperienceEditor instead
    IsPageEditorClassic, Deprecated always false
    IsPageEditorDesigning, Obsolete Use IsExperienceEditorEditing instead
    IsPageEditorEditing, Obsolete Use IsExperienceEditorEditing instead 
    IsPageEditorNavigating, Deprecated always false