In some cases it may be useful to detect when an EPiServer page is displayed in DOPE (Direct On-Page Editing) mode rather than the “normal” View mode. This is how to do it:
string dopemode = Request.Params["DopeMode"]; if (!String.IsNullOrEmpty(dopemode) && dopemode.ToLower() == "enable") { // DOPE mode detected! }
This is the only way I have found to do this, but it feels like there should be a DOPE flag somewhere in the EPiServer API. If anyone has found it, please leave a comment 🙂