The main difference between custom and user widgets is that custom widgets must inherit the SimpleView class. That makes the registration of custom widgets different, that is, you must provide the complete path when registering a new custom widget in Sitefinity Toolbox. In contrast, you register user widgets by virtual path. In addition, to map the markup file of a custom widget with its code-behind, you must override the LayoutTemplatePath property and put the complete path of the markup instead. For more information, see:
More information could be found in our Sitefinity documentation
IsDesignMode - static method which determines whether the control is in Sitefinity design mode - you are editing a page. There are also IsPreviewMode- determines whether the control is in Sitefinity preview mode.
IsBackend -determines whether a control instance is in backend. Please refer to the sample code below:
.IsDesignMode() && !
Alternatively, you can use
when checking for DesignMode in a control.
You could check whether your control which inherits from UserControl in in design mode using:
WebUserControl2 : System.Web.UI.UserControl
sender, EventArgs e)
//hide it here
There is no need to revert your control and inherit from SimpleView to be able to check whether the control is in design mode.
However if you decide you can derive your control from the SimpleView or the SimpleScriptView classes, which are part of the Sitefinity SDK. They are designed to improve the development of controls for Sitefinity. For a detailed step-by-step tutorial on creating controls, see How to create a NewsRotator control
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal
and vote to affect the priority of the items