More in this section

Forums / Bugs & Issues / IsDesignMode showing true in preview mode

IsDesignMode showing true in preview mode

3 posts, 0 answered
  1. Sean
    Sean avatar
    271 posts
    Registered:
    31 May 2006
    07 Sep 2011
    Link to this post
    Hi,

    I have created a control that inherits from SimpleView and using the sample on detecting if something is in design mode.  It looks like there is a bug there now? Because IsDesignMode is returning true when previewing a page with that control on it, this isn't the expected behaviour, I would expect IsPreviewMode to be true and IsDesignMode to be false when viewing a page that is in Design Mode?

    Ta
    Sean
     



  2. Jochem Bökkers
    Jochem Bökkers avatar
    787 posts
    Registered:
    13 Aug 2007
    07 Sep 2011
    Link to this post
    Hey Sean,

    Just to back you up, this has been default behavior since at least 4.0.1210.

    I've always assumed that isDesignMode and IsBackend is a way of detecting if you'reediting in the back end or in 'live back-end' mode. When designing FE usercontrols they'll always return true and the isPreviewMode is just a way of checking to see if you need to display a userfriendly message or try and show the actual output.

    For frontend usercontrols the isDesignMode and IsBackend isn't that much different but I can imagine someone designing some backend control or module where these two start to make sense.

    Jochem.
  3. Sean
    Sean avatar
    271 posts
    Registered:
    31 May 2006
    07 Sep 2011
    Link to this post
    Hey Jochem,

    That is interesting, we used it in the RC version for some of our controls that we ported across from SF 3.7 and haven't checked back since. There is a work around with using the IsBackend and IsPreviewMode settings too but I always understood the IsDesignMode is that it is usually for showing some custom content or instructions for your widgets/controls when they are dropped onto the page.

    I am not too bothered how it should work but I know when porting any Standard ASP.Net controls or 3.7 controls across most developers would expect it to work the same way.

    Thanks for your input.
    Sean
3 posts, 0 answered