IsDesignMode showing true in preview mode

Posted by Community Admin on 04-Aug-2018 03:38

IsDesignMode showing true in preview mode

All Replies

Posted by Community Admin on 07-Sep-2011 00:00

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
 



Posted by Community Admin on 07-Sep-2011 00:00

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.

Posted by Community Admin on 07-Sep-2011 00:00

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

This thread is closed