How to detect if Edit Mode is enabled on the server side in DNN 9?

464 Views Asked by At

How can I detect if DNN is in Edit Mode in the Back-End code?

I looked at this link, but it seems to deal with DNN7 on the Client-Side: http://www.dnnsoftware.com/answers/dnn7-detect-page-edit-mode-in-js

For example:

if(DotNetNuke.EditMode == true){
// Do Something
}
1

There are 1 best solutions below

1
On BEST ANSWER

PortalModuleBase has an IsEditable property that is true when in Edit Mode.

if(IsEditable){
 // Do Something
}