Mvc Widget Designers - Sitefinity/PowerTools GitHub Wiki
In version 5.1 Sitefinity has implemented ability to build widgets using ASP.NET MVC. This addition was welcomed by numerous developers, however, ASP.NET MVC support did not extend to building widget designers.
In case you are not familiar with concepts of Sitefinity widgets and widget designers, please take a look at this short video: http://www.youtube.com/watch?v=Go7GiYIyPxg
With Sitefinity Power Tools, you are now able to implement MVC based designers for all widgets (including the WebForms widgets).
To apply an MVC based widget, all you need to do is register a Controller or a Web Control that represents the widget with the Controller that represents the designer.
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
// register mvc designers
PowerTools.Instance
.Mvc
.RegisterDesigner<AdHocListController, AdHocListDesignerController>();
}
}
RegisterDesigner method accepts two generic parameters. The first generic parameter is the type of the widget, where the second generic argument is the type of the widget designer.
Note that the type of widget designer must implement an IController interface.