MVC Routing

Valentina Manokhina asked on April 22, 2014 03:55

We started to implement project using Kentico 8 and ASP.NET MVC 4. To mange Urls we registered routes in Route.config file. We tried to call DocumentContext.CurrentDocument inside our controllers but it returns fake data: always the page with default alias path ('/'). If urls are configured manually via cmsdesk everything works fine, but it doesn't seem to be rational to add url for each page. Could this be fixed in any other way except managing routes manually?

Recent Answers

Richard Sustek answered on May 5, 2014 02:20


The problem is that in this case the Context itself is not available and therefore calls such as CurrentDocument will not return any document. The solution for this is to get the Node/Document manually.

Kind regards,

Richard Sustek

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.