Upgraded from Umbraco v4 to v7 SurfaceController No route in the route table matches the supplied values

1.1k views Asked by At

I recently converted our intranet Umbraco site from v4 to v7.2 and also converted all the webform masterpages to mvc. I am trying to convert a usercontrol that should be a child action to a SurfaceController but I am getting the dreaded "No route in the route table matches the supplied values" error when trying to call the action:

@Html.Action("ServiceStatusInfo", "ServiceStatusSurface")

This is just a get action that doesn't require a view or a model. It just calls the action on the server and the server updates a file on the server that then get's read by some javascript. I have done a lot of searching and I created a sample solution using Umbraco 7 and created a controllers folder, then a "MySurfaceController" and I was able to call the action from the masterpage of the sample solution with no issues but in the recently converted project it seems like there is some weird routing issue going on. I compared the web.config's for both the current project and the sample one and they pretty much have the same entries (I thought maybe I missed something). It seems that my converted project is not recognizing the routing. Any help will be appreciated.

Here is the SurfaceController

using Umbraco.Web.Mvc;
using System.Web.Mvc;

namespace MyUmbracoApp.Controllers
{
public class ServiceStatusSurfaceController : SurfaceController
{
    // can't reach this either:
    public ActionResult Index()
    {
        return Content("hello world");
    }

    // this is what I am trying to reach
    [ChildActionOnly]
    public ActionResult ServiceStatusInfo()
    {
       // do some stuff to get the status

        return CurrentUmbracoPage();
    }
  }
 }

I have also tried using the "PluginController" option even though this is not a plugin with the "area" attribute but same problem.

Maybe there is a workaround that I am not aware of ?

1

There are 1 answers

1
Jerode On

Change StatusInfo to ServiceStatusInfo in your action call. This should match the name of the action.

@Html.Action("ServiceStatusInfo", "ServiceStatusSurface")