CMS Page Mode

Posted by Community Admin on 03-Aug-2018 00:22

CMS Page Mode

All Replies

Posted by Community Admin on 12-May-2011 00:00

I use below code in sitefinity 3.7 to use my code only on live site not in edit mode. What should I write code for sitefinity 4?? Because this code is not working in sitefinity 4

Telerik.Web.CmsPageBase page = this.Page as Telerik.Cms.Web.CmsPageBase;
if (page.PageMode == Telerik.Cms.Web.CmsPageMode.Live)
   // something

Posted by Community Admin on 12-May-2011 00:00

Hi Asif,

This should do the trick:

if (!this.IsDesignMode())
  // do something if not in edit mode

Cheers,
Phill

This thread is closed