PageMode in 4.0 beta 2

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

PageMode in 4.0 beta 2

All Replies

Posted by Community Admin on 08-Nov-2010 00:00

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.

Posted by Community Admin on 08-Nov-2010 00:00

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

Posted by Community Admin on 09-Nov-2010 00:00

Is there an enum anywhere on the PageManager like the PageMode enum on the CmsPageBase?

Posted by Community Admin on 09-Nov-2010 00:00

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

Posted by Community Admin on 09-Nov-2010 00:00

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.

Posted by Community Admin on 09-Nov-2010 00:00

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

This thread is closed