Try our conversational search powered by Generative AI!

Cant add new MenuSection in newer version of EpiServer

Vote:
 

Hi, I experimented with MenuSection on the Alloy Demo running Epi v10.0.1

I Basically added a new folder under `modules/_protected`, with the current structure: 

Controllers/
Models/
Views/
Scripts/
Support/

In the controllers folder i got a HomeController.cs with the following code: 

    [MenuSection("/global/hello",Text = "Hello")]
    [Authorize(Roles = "Administrators,CmsAdmins,WebAdmins")]
    public class HomeController : Controller
    {
        [MenuItem("/global/hello/test", Text = "Test")]
        [HttpGet]
        public ActionResult Index()
        {
            var vm = new HomeViewModel();

            return View(Helper.ResolveView("Home/Index.cshtml"), vm);
        }
}

This works just fine - But when trying to do the same in Epi v10.4.3 - it doesnt work. 

I have tried looking trough the breaking changes, but i cant see that there should be anything. 

Using a menuprovider seems to work tho - but the examples just shows how to do it using aspx, so im unsure about what url to use as routing

#176636
Edited, Mar 23, 2017 10:37
Vote:
 

What happens if you use [MenuItem] instead?

#176920
Mar 29, 2017 18:38
* 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.