The MVC widgets are registered automatically when there is an attribute added before each controller class
, Title =
, SectionName =
MyWidget1Controller : Controller
Hey David, thanks for helping out!
I created brand new projects, with different URLs 3 times. I then created the MVC controller and corresponding views, with proper namespace and attribute decorated onto the controller. All 3 times, the widget did not show up *until* I created at least one page in the web app.
In fact, it didn't show up at all unless I created a page first. My workflow was=> Create custom template based a default Sitefinity one => attempt to add my widget to a container...no widget!
Once I created a page using a default template, then followed the above workflow, I was able to see my widget.
I had the same issue as Gary and later Brenton. So firstly I couldn't register my own mvc widget to toolbox. As Stanislav wrote the cause was custom project name without word "SitefinityWebApp" so automatic registration is not working. I've done it manually according to his instructions and it appears on my toolbox. Nice ! ... not !
It didn't work beacuse I had the same problem as Brenton. My widget was returning NullReferenceException and I didn't know why ?
A few hours later... Me and my friend (Thx Rafal) figured out that manual way needs more information. When you have created node with your widget, you have to add into "Toolbox item parameters" new parameter called "ControllerName" and put there Key "ControllerName" and Value with the same string as before in field "Controller CLR Type" ( so path to your controller).
And this is how it should works !
P.S: At least for me ;)
All the best !