More in this section

Forums / Developing with Sitefinity / disable rendering on Pages Admin section

disable rendering on Pages Admin section

2 posts, 0 answered
  1. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    18 Jul 2008
    Link to this post
    I have a banner that uses ajax to rotate, but when I am working in the Pages Administration, it appears to be causing problems. is there any way to disable this if the page is in the admin or edit mode?
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    21 Jul 2008
    Link to this post
    Hello SelArom,

    You can determine if the page is viewed in Administration with this code:
        protected void Page_Load(object sender, EventArgs e) 
        { 
           //returns true if it is viewed in administration part. 
           IsPageInAdmin(); 
        } 
        private bool IsPageInAdmin() 
        { 
           // will return TRUE is the page is viewed in administration part 
            if (this.Page.Request.QueryString.ToString().IndexOf("cmspagemode=preview") > 0) 
              return true
          // will return TRUE is the page is in editing mode 
            if (this.Page.Request.QueryString.ToString().IndexOf("cmspagemode=edit") > 0) 
              return true
          // the page is viewed in the public part. 
          return false
        } 

    Using this code, you can disable your banners if they are not viewed in the public side.

    I hope this helps.

    Kind regards,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
2 posts, 0 answered