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?
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)