1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / CMS Page Mode

CMS Page Mode

2 posts, 0 answered
  1. Asif
    Asif avatar
    110 posts
    Registered:
    18 Nov 2010
    12 May 2011
    Link to this post
    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
    }
  2. Phill Hodgkinson
    Phill Hodgkinson avatar
    362 posts
    Registered:
    10 Nov 2004
    12 May 2011
    Link to this post
    Hi Asif,

    This should do the trick:
    if (!this.IsDesignMode())
    {
      // do something if not in edit mode
    }

    Cheers,
    Phill
2 posts, 0 answered