PageMode in 4.0 beta 2
I am trying to get the page mode that sitefinity 4.0 beta 2 is running under. I have tried the following
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
Is there an enum anywhere on the PageManager like the PageMode enum on the CmsPageBase?
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();
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.
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