Full code of the widget designer class

NEW TO SITEFINITY?
using System.Collections.Generic;
using Telerik.Sitefinity.Web.UI;
using Telerik.Sitefinity.Web.UI.ControlDesign;
namespace SitefinityWebApp.SimpleWidgetDesigner
{
public class SimpleWidgetDesigner : ControlDesignerBase
{
protected override void InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container)
{
base.DesignerMode = ControlDesignerModes.Simple;
}
//Reference the template of the simple widget designer
public override string LayoutTemplatePath
{
get
{
if (string.IsNullOrEmpty(base.LayoutTemplatePath))
return layoutTemplatePath;
return base.LayoutTemplatePath;
}
set
{
base.LayoutTemplatePath = value;
}
}
private static readonly string layoutTemplatePath = ControlUtilities.ToVppPath("SimpleWidget.Resources.Views.SimpleWidgetDesigner.ascx");
//Reference the client script for the symple widget designer
public override IEnumerable<System.Web.UI.ScriptReference> GetScriptReferences()
{
var res = new List<System.Web.UI.ScriptReference>(base.GetScriptReferences());
var assemblyName = this.GetType().Assembly.GetName().ToString();
res.Add(new System.Web.UI.ScriptReference("SimpleWidget.Resources.Views.SimpleWidgetDesigner.js", assemblyName));
return res.ToArray();
}
}
}

Want to learn more?

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

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.

Web Security for Sitefinity Administrators

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.

Foundations of Sitefinity ASP.NET Core Development

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.

Was this article helpful?