More in this section

Forums / General Discussions / PageMode in 4.0 beta 2

PageMode in 4.0 beta 2

6 posts, 1 answered
  1. Chris
    Chris avatar
    9 posts
    Registered:
    11 Aug 2010
    08 Nov 2010
    Link to this post
    I am trying to get the page mode that sitefinity 4.0 beta 2 is running under.  I have tried the following

    Telerik.Cms.Web.CmsPageBase page = this.Page as Telerik.Cms.Web.CmsPageBase

    however every time I attempt to debug this project is complains that it is looking for version 

    Telerik.Web.UI, Version=2009.3.1103.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4'

    of Telerik.Web.UI.  Currently I have version 2010.2.826.40 that came with beta 2 referenced in the project.  What telerik assembly is looking for this old version?   I have no version of Telerik.Web.UI in my GAC and no  version number specified in my web config.  Any help would be appreciated.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    08 Nov 2010
    Link to this post
    Hi Chris,

    CmsPageBase is part of Telerik.Cms and this assembly and namespace cannot be used in Sitefinity 4.0 edition. It looks like you have a  class library or an assembly that has a reference to an old version of Telerik.Web.UI and this is why you are getting the exception above.

    In Sitefinity 4.0 you can use PageManager class or/and our fluent API to work with pages. You can take a look at our developers guide.

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Chris
    Chris avatar
    9 posts
    Registered:
    11 Aug 2010
    09 Nov 2010
    Link to this post
    Is there an enum anywhere on the PageManager like the PageMode enum on the CmsPageBase?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    09 Nov 2010
    Link to this post
    Hello Chris,

    There are control extensions - ControlExtensions

    IsDesignMode
    IsPreviewMode
    IsBackend

    sample

    protected override void OnPreRender(EventArgs e)
     {
             base.OnPreRender(e);         
             if (this.IsDesignMode() && !this.IsPreviewMode())
             {
                 this.Controls.Clear();
     
             }
           
       }


    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
  5. Chris
    Chris avatar
    9 posts
    Registered:
    11 Aug 2010
    09 Nov 2010
    Link to this post
    Thanks for that answer.  I have one other question.  We are creating our own custom user controls and not using server controls inheriting from simple control.  Is there a base class that the user controls are suppose to be inheriting from other then System.Web.UI.UserControl (a telerek base class).  I am newer to sitefinity and I want to make sure that I am using the product the way it is intended.

    Thank you for all of your assistance.
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    09 Nov 2010
    Link to this post
    Hi Chris,

    We do no not have any custom wrappers for  System.Web.UI.UserControl, so you can inherit from the ASP.NET class.

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
6 posts, 1 answered