Try Now
More in this section

Forums / Developing with Sitefinity / How do I implement custom routes?

How do I implement custom routes?

2 posts, 0 answered
  1. Bryson
    Bryson avatar
    13 posts
    14 Jan 2016
    14 Jan
    Link to this post

    I have some of my controllers located in a subfolder in my Controllers folder. Similarly, I have the views located under a similar folder structure.

    Example: Mvc->Controllers->AccountSettingsControllers->ChangeUserNameController.cs



    When I run it, the route comes out as "Mvc->Views->ChangeUserName". How can I setup my controller route so it goes from "Mvc->Views->ChangeUserName" to "Mvc->Views->AccountSettingsViews->ChangeUserName"?


    Side Question here: Where is sitefinity's code documentation? I want to know the meaning behind certain parameters of their RouteAttributes. Documentation in the code is lacking, and I can't find any reference to it online.

  2. Paul
    Paul avatar
    13 posts
    29 Jul 2015
    15 Jan
    Link to this post

    Hi Bryson

    You can keep your controller the way they are and Sitefinity should pick them up, or you can see here you can add MVC Areas http://docs.sitefinity.com/bug-tracker-create-an-arearegistration-class

    The views you will need to either add a new ViewEngine with the location of the folders you would like searched when the site initialises for views (http://www.codeproject.com/Articles/294297/Creating-your-own-MVC-View-Engine-into-MVC-Applica)


2 posts, 0 answered