<?xml version="1.0" encoding="UTF-8"?>
<entry>
  <category-id type="integer">6</category-id>
  <content>&lt;p&gt;In Sitefinity, we sometimes want to be able to know if a custom user control we have built is in edit mode, ie when you are in the designer. This can be useful to not execute javascript or not draw certain things that would mess up the usability / cause errors in the designer. It is quite easy, we are basically checking for the querystring cmspagemode. &lt;/p&gt;

&lt;pre name="code" class="csharp"&gt;
string mode = Request.Querystring.Get("cmspagemode");

if(mode != null)
{
    // running in SF preview mode
    if(mode == "edit")
    {
        // running in edit mode
    }
}
&lt;/pre&gt;</content>
  <created-at type="datetime">2009-06-03T11:05:57-07:00</created-at>
  <id type="integer">31</id>
  <title>Check if user control in edit mode</title>
  <updated-at type="datetime">2009-06-03T11:09:23-07:00</updated-at>
</entry>
