More in this section

Forums / Developing with Sitefinity / detecting page mode

detecting page mode

4 posts, 0 answered
  1. Kevin Pipher
    Kevin Pipher avatar
    91 posts
    Registered:
    30 Nov 2005
    14 Feb 2008
    Link to this post
    Hi,

    I'm in the process of developing some user controls, where I need to be able to detect whether the current page is in edit mode. What is the best way to accomplish this?

    I know that I could check for Request.Querystring["cmspagemode"] but I'd prefer to avoid querystring information if possible.

    I looked through the api documentation but couldn't find what I was looking for. Is there a status enumerator such as Telerik.Cms.PageMode or similar?

    Thanks!

    Kevin
  2. bnye
    bnye avatar
    332 posts
    Registered:
    22 Sep 2005
    14 Feb 2008
    Link to this post
    I think you have to check the querystring. Some folks discussed this over here:

    http://www.sitefinity.com/support/forums/support-forum-thread/b1043S-hmmca.aspx

    Hope that helps.

    Sincerely,

    Ben
  3. Vassil Daskalov
    Vassil Daskalov avatar
    261 posts
    Registered:
    18 May 2013
    15 Feb 2008
    Link to this post
    Hi Kevin,

    You can check whether you are in edit page mode in two ways. Both are described in the forum thread provided by Ben. They are either by checking for the cmspagemode query key value or by ensuring that the current Page object is null.

    Sincerely yours,
    Vassil Daskalov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  4. Kevin Pipher
    Kevin Pipher avatar
    91 posts
    Registered:
    30 Nov 2005
    15 Feb 2008
    Link to this post
    Thanks Ben and Vassil for replying.  I searched before but missed that thread.

    I like the idea of using a custom property. I already have a base user control class that all my user controls inherit from so I'll add the functionality there similar to the example given.

    Thanks again.

    Kevin
Register for webinar
4 posts, 0 answered