Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Charles Williams 5 posts 71 karma points
    Feb 23, 2017 @ 15:39
    Charles Williams
    0

    Proper way to route to controllers in Umbraco ASP.NET

    I posted this on stackoverflow: http://stackoverflow.com/questions/42397136/proper-way-to-route-to-controllers-in-umbraco-asp-net-iapplicationeventhander

    I am trying to understand the proper way to route controllers in Umbraco when you put all your models, controllers, helpers, etc,. into their own core for a multi-site setup. My structure is as such:

    MyApp.Core
    --Properties
    --References
    --bin
    --Events
      |EventHandlers.cs
    --Directory
      --Controllers
        |DirectoryController.cs
      --Helpers
        |ContextHelpers.cs
      --Models
        |DirectoryModel.cs
    --AnotherSite
      --Controllers
      --Helpers
      --Models
      --Services
    --Shared
      --Controllers
        |HomePageController.cs
      --Helpers
        |Extensions.cs
    |app.config
    |packages.config
    
    MyApp.Umbraco
    --Properties
    --References
    --bin
    etc........
    --Views
      --Directory
        --Partials
          |DirectoryFilters.cshtml
        |DirectoryBase.cshtml
        |DirectoryHome.cshtml
        |FDirectory.cshtml
        |SDirectory.cshtml
      --Partials
      --Shared
      |Base.cshtml
      |Web.config
    etc........
    

    I posted all my code, that works on StackOverflow, but what would be the ideal way to handle the routing to the custom controllers in this type of setup? Having to create an action for every page in a website doesn't seem efficient.

Please Sign in or register to post replies

Write your reply to:

Draft