The custom controls are independent from the project, which they are being used in. They consist of a single dll, which can be reused across different applications.
To create a control of this type, you must first create an empty custom control. The control can reside in Sitefinity CMS solution or in another solution. You will create a control in the scope of the Sitefinity's solution.
To create an empty custom control, perform the following:
.cs
Rotator.cs
NOTE: Make sure your class library targets the same .NET framework version as your project. To verify right-click the NewsRotator class library and select Properties. In the Application menu item, select the target framework.
In Sitefinity CMS, you can create your controls as standard ASP.NET custom controls or you can derive them from one of the built-in base classes - SimpleView, SimpleScriptView. They provide you with additional features, which, for example, are not available in the WebControl class.
SimpleView
SimpleScriptView
In this tutorial you derive the NewsRotator control from the SimpleView class. To do this, you must add a reference to Telerik.Sitefinity.dll in your NewsRotator project. Perform the following:
Telerik.Sitefinity.dll
Telerik.Sitefinity
Telerik.Sitefinity.Samples.Dependencies
NewsRotator.cs
InitializeControls
LayoutTemplateNameproperty
LayoutTemplateName
EXAMPLE: For more information about the code of the Rotator.cs file, see NewsRotator widget: Code of the control class.
You must reference the control's assembly in the Sitefinity CMS project. In this tutorial, the control and Sitefinity CMS project are located in one and the same solution. To add a reference, perform the following:
Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.
This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.
This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important