Using BetterCMS 2.0.6.192 directly from NuGet. Brand new c# project.
I've been through the setup multiple times but cannot get a Server Widget to call custom Controller/View code.
I am attempting to create a custom server widget. I have the Phonebook.cshtml in the View/Widgets folder and registered as as Widget on a page in the site. This widget view will render with some simple html but when I try to Post or render a partial view I get an error "No route in the route table matches the supplied values".
Within the Phonebook.cshtml widget I have added
@{ Html.RenderAction("Index", "Phonebook", new {Area = ""}); }
but the partial view is not found. The error message, seen on the page with the widget is,
"Error rendering view "~/Views/Widgets/Phonebook.cshtml": No route in the route table matches the supplied values.".
I have a PhonebookController in the /Controllers folder in the /Views folder I have an Index.cshtml. While debugging the Index view is never fired.
I have also tried adding
@{ Html.RenderAction("Index", "Phonebook", new { Area = "Phonebook" }); }
to the /Views/Widgets/Phonebook.cshtml. I have /Areas/Phonebook/Controllers/PhonebookController.cs and /Areas/Phonebook/Views/Index the Index action is never fired.
I think it might have to do with routing. In the PhonebookAreaRegistration.cs file I have
context.MapRoute( "Phonebook_default", "Phonebook/{controller}/{action}/{id}", new { action = "Index", id = UrlParameter.Optional } );
In the /App_Start/RouteConfig.cs I have commented out the default routing as instructed in the docs.
Help.
This is a cross posted in Better CMS forum, not sure how much traffic that forum gets anymore. http://www.bettercms.com/support/widgets-and-modules/struggling-with-server-widget/