NodeContent and view rendering


I'm using ASP.NET MVC 5.1 and have some problems with the latest version of Commerce and routing for NodeContent (categories). VariationContent, ProductContent, BundleContent and PackageContent all work fine and the normal way, but for NodeContent I get a 404 (on page edit) and my controller isen't registered to render for that type, instead it tries to use the EPiServer.Shell.UI.Controllers.EPiDefaultShellModuleController controller.

I have a very basic setup:

public class TestNodeContentController : ContentController<TestNodeContent>
        public ViewResult Index()
            return View();


[CatalogContentType(GUID = "4A08DC98-FE1E-443E-BF0F-123993957118", MetaClassName = "Test_Node_Content")]
    public class TestNodeContent : NodeContent


Any ideas where I should look? Somewhere there must be a misconfiguration in my setup.

The URL it tries to use looks something like this:





Apr 07, 2014 16:16

I didn't get the problem when I tested. Can you run the following code after initialization has been done (for example in one controller): ServiceLocation.ServiceLocator.Current.GetInstance<EPiServer.DataAbstraction.IContentTypeRepository>().Load("TestNodeContent ").SupportedTemplates

You will find the templates that has been registered during initialization in that property. It would be intresting to see if the TestNodeContentController is one of the supported templates.

Apr 08, 2014 10:01

When I tested within my ProductController it showed that the right controller was registered to handle TestNodeContent (TestNodeContentController). It was also the only one registered for that type. Curious that I get a 404 when within the Catalog interface and then just for types that inherit from NodeContent.


Apr 08, 2014 10:36

I will try to reproduce it.

Apr 08, 2014 10:38

One more thing to look up. The TemplateResolver has two events, TemplateResolving and TemplateResolved. If you listen to those events, and look what the template resolver resolves, it might give us a hint.

Apr 08, 2014 13:27

When I check TemplateResolved, SelectedTemplate is actually TestNodeController. Very strange that it doesn't render that controller and view.

Apr 08, 2014 14:42

Whats the assembly version of EPiServer.Shell.UI?

Apr 08, 2014 14:43

Apr 08, 2014 14:44

I now see that I use of EPiServer.Shell.UI (did a update-package on the project). I can still not get the problem.

Have you registered any routes yourself (the default route for example), and if so, where has it been registered?

Apr 09, 2014 15:39

I had the default route registered through the RegisterRoutes method in global.asax, but even when removing this method the behavior was the same.

Apr 10, 2014 10:08
* 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.