0
votes

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
Could you try adding @Html.Action("Index", "ServiceStatusSurface") to your base layout page and see if hello world will display where you put it?Jerode
Sorry for the delayed response, I didn't realize you commented. I have tried that in the MasterPage.cshtml which is my base page and still get the same error. Considering that I switched from v4 I have not created _Layout.cshtml page and just reference the MasterPage.cshtml as my base layout page. Maybe I should do that ? I don't think that would have any effect on the routing issue though.M Khan
I actually also tried this today: stackoverflow.com/questions/22925202/… but still no go same error. I thought maybe the "Startup.cs" file would help with the routing issue but it does not. Maybe there is something lingering somewhere that is overwriting umbraco routing table.M Khan

1 Answers

0
votes

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

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