Try our conversational search powered by Generative AI!

Can't create an admin plugin

Vote:
 

I'm having trouble creating an admin plugin (http://world.episerver.com/blogs/Paul-Smith/Dates1/2011/8/Creating-EPiServer-AdminEdit-Plug-ins-using-MVC/).

The controller doesn't seem to be hit. This is how I tried to do it:

Installed a new fresh Alloy site (9.6.1.0) and created the plugin.

namespace EPiServerSite1.Controllers
{
    [EPiServer.PlugIn.GuiPlugIn(Area = EPiServer.PlugIn.PlugInArea.AdminMenu, Url = "/SuperDuperPlugin/Index", DisplayName = "Super duper tool")]
    //[Authorize(Roles = "WebAdmins")]
    class SuperDuperPluginController : Controller
    {
        public ActionResult Index()
        {
            return View("~/Views/Shared/SuperDuperPlugin/Index.cshtml");
        }
    }
}

And then added the route in Global.asax.cs

protected override void RegisterRoutes(RouteCollection routes)
{
    base.RegisterRoutes(routes);
            
    routes.MapRoute("myadminplugin", "SuperDuperPlugin/{action}", new { controller = "SuperDuperPlugin", action = "Index" });
}

It seems that the route is working because the url http://localhost:6904/superduperplugin returns a different 404 (from ASP.Net?), than the url http://localhost:6904/superduperpluginxxxx (404 from IIS). But the controller is never hit. I've tried different namespace for the controller without any luck.

What am I doing wrong?

#144123
Feb 08, 2016 10:52
Vote:
 

Your SuperDuperPluginController is not public. Make it public and it'll work.

#144126
Edited, Feb 08, 2016 11:15
Vote:
 

Argh!!! Haha, thank you!!!

#144127
Feb 08, 2016 11:19
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.