Try our conversational search powered by Generative AI!

Custom routes

Vote:
 

I am trying to creata a custom route which will accept this action

        public async Task Index(ReportPage currentPage, string id)
        {
            /* Implementation of action. You can create your own view model class that you pass to the view or
             * you can pass the page type for simpler templates */

            // todo: check if the report id is valid

            Report report = await // get report

            var model = new ReportPageViewModel(currentPage, report);
            return View(model);
        }

I have added this route

        routes.MapContentRoute(
             name: "Epi",
             url: "{language}/{node}/{action}/{id}",
             defaults: new { controller = "ReportPage", action = "Index", id = UrlParameter.Optional }
        );

But I get this error

Page could not be loaded

The link you specified does not work. This may either be the result of temporary maintenance or an incorrect link.

#186735
Jan 03, 2018 14:37
Vote:
 

What is the URL you are using in the failing request?

#186994
Jan 09, 2018 23:58
* 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.