1

I want how to know if a page is in mode design with code-behind and/or xslt.

Does anyone knows how can I do that?

1 Answer 1

1

In Code-Behind you can use:

if( SPContext.Current.FormContext.FormMode == SPControlMode.Edit ){
    // Page in Edit Mode.
}

In JavaScript, you can use:

if( document.forms[MSOWebPartPageFormName].MSOLayout_InDesignMode.value ){
    console.log( 'Page in Edit Mode' ); 
} 

You can also use the EditModePanel Control if you just want to use markup. Here's a reference: http://msdn.microsoft.com/en-us/library/office/jj822364(v=office.15).aspx

(These will only work on Publishing Pages)

1
  • know how to do with XSLT (DFWP) ?? Sep 23, 2014 at 2:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.