How do I implement custom routes?

Posted by Community Admin on 04-Aug-2018 19:32

How do I implement custom routes?

All Replies

Posted by Community Admin on 14-Jan-2016 00:00

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

Mvc->Views->AccountSettingsViews->ChangeUserName->Index.cshtml

 

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.

Posted by Community Admin on 15-Jan-2016 00:00

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 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 (www.codeproject.com/.../Creating-your-own-MVC-View-Engine-into-MVC-Applica)

 

This thread is closed