Domanda

We've recently adopted Sitefinity and have begun creating MVC widgets. Overall this has been working as advertised. Then, after having tested my new widget, I realized I named it wrong! I then changed my controller name from MyWidgletController to MyWidgetController. After making the change I began getting the exception "The controller with the name 'MySitefinityApp.Mvc.Controllers.MyWidgletController' cannot be resolved". Scratch my head. Build...again. Still same problem. Recycle App-Pool. Same problem.

Here is the controller I'm working with (Names have been changed to protect the identity of the widgets involved):

[ControllerToolboxItem(Name = "MyWidget", Title = "My Widget", SectionName = "My Custom Widget Section")]
public class MyWidgetController : Controller
{
    public ActionResult Index()
    {
        return View("Default");
    }
}

Question: Why is Sitefinity still looking for MyWidgletController when it no longer exists?

È stato utile?

Soluzione

It turns our that Sitefinity persists the name of the controller to its DB. If you run into this problem you can find your undead controller here:

select top 10 * from sf_control_properties where name = 'ControllerName'

Ugh. This is horrific. Sitefinity, you should be ashamed.

Altri suggerimenti

LOL, I have been the same situation where i created custom widget with mvc. another workaround is Goto >> /Sitefinity/Administration/Settings/Advanced

Then Below ToolBoxes>>PageControls>>Sections you will find out your Modules, then delete necessary dead widgets

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top