Determine display mode of sharepoint page <p>I have this question many times and bored while trying to find good solution. Dont understand why microsoft not include method which can easy determine mode of display page: "normal display" or in "design mode". It have many advices of check different variables, but it cant uniquely say that page in design on different type of page(webpart page and wiki page) and on postback or not.</p> <p>Is finally tired me and i write this:</p> <pre><code> public static bool IsDesignTime() { if (SPContext.Current.IsDesignTime) return true; if (HttpContext.Current.Request.QueryString["DisplayMode"] != null) return true; var page = HttpContext.Current.Handler as Page; if(page == null) return false; var inDesign = page.Request.Form["MSOLayout_InDesignMode"]; var dispMode = page.Request.Form["MSOSPWebPartManager_DisplayModeName"]; var wikiMode = page.Request.Form["_wikiPageMode"]; var we = page.Request.Form["ctl00$PlaceHolderMain$btnWikiEdit"]; if (inDesign == null &amp; dispMode == null) return false; //normal display if (we == "edit") return true; //design on wiki pages if (page is WikiEditPage &amp; page.IsPostBack &amp; inDesign == "" &amp; dispMode == "Browse" &amp; wikiMode == "") return false; //display wiki on postback if (inDesign == "" &amp; dispMode == "Browse" &amp; (wikiMode == null | wikiMode == "")) return false; //postback in webpart pages in display mode if (inDesign == "0" &amp; dispMode == "Browse") return false; //exiting design on webpart pages return true; } </code></pre> <p>Does anybody have better solution?</p>