private void InitializeProfiler() { var doProfile = false; // Check if cookie already exists or if startProfile is found in the query string. if (CookieUtil.AppProfiler == "do") { doProfile = true; } else if (Request.QueryString["startProfiler"] != null) { CookieUtil.AppProfiler = "do"; doProfile = true; } // Check if stopPrilie is found in the query string. if (Request.QueryString["stopProfiler"] != null) { CookieUtil.RemoveAppProfiler(); doProfile = false; } if (doProfile) { MiniProfiler.Start(); } }