Skip to content

Instantly share code, notes, and snippets.

@dhunmoon
Created May 5, 2016 08:54
Show Gist options
  • Save dhunmoon/0731908c9dacafa88e55a16ff7d9560d to your computer and use it in GitHub Desktop.
Save dhunmoon/0731908c9dacafa88e55a16ff7d9560d to your computer and use it in GitHub Desktop.
How to Verify if the Page is in Edit Mode using JavaScript in Page Layout SharePoint 2013
<PublishingWebControls:EditModePanel ID="EditModelPanel1"
runat="server" PageDisplayMode="Edit">
<h1>You are in EDIT mode</h1>
<!-- Place you're javascript for execute only in edit mode -->
</PublishingWebControls:EditModePanel>
<PublishingWebControls:EditModePanel ID="EditModelPanel2"
runat="server" PageDisplayMode="Display">
<h1>You are in DISPLAY mode</h1>
<!-- Place you're javascript for execute only in display mode -->
</PublishingWebControls:EditModePanel>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment