Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Andrew Duff 13 posts 53 karma points
    Jul 04, 2013 @ 20:31
    Andrew Duff
    0

    SurfaceControllers

    Hi, I have upgraded a umbraco solution I had to 6 and have redone the site with MVC but now have a issue.

    I have a surface controller as below in the app_code folder 

    public class UtilsSurfaceController : Umbraco.Web.Mvc.SurfaceController
    {

        [HttpGet]
        public System.Web.Mvc.ActionResult GetAddress()
        {
            return Content("Hello World");
        }

    }

    Very simple doing next to nothing I have checked to see if the route was registered using

     

    @foreach (System.Web.Routing.Route route in RouteTable.Routes)
        {
            @route.Url
        }

    This correctly shows the route in the routing table

    mini-profiler-resources/{filename}
    umbraco/RenderMvc/{action}/{id}
    Install/PackageInstaller/{action}/{id}
    umbraco/RestServices/{controller}/{action}/{id}
    umbraco/Surface/UtilsSurface/{action}/{id}
    umbraco/Surface/MySurface/{action}/{id}
    umbraco/Api/DomainsApi/{action}/{id}
    umbraco/Api/ExamineManagementApi/{action}/{id}

    However going to the site

    http://domain.local/umbraco/Surance/UtilsSurface/GetAddress/ ;

    returns the below and nothing I do works. Everything else on the site in regards to RenderMvcController works correctly without issue.

    Server Error in '/' Application.

    The resource cannot be found.

    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly. 

    Requested URL: /umbraco/Surface/UtilsSurface/GetAddress/


    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18045
  • Andy Butland 422 posts 2334 karma points MVP 4x hq c-trib
    Jul 04, 2013 @ 22:06
    Andy Butland
    0

    This probably isn't particularly helpful, but FWIW I've replicated your code into my 6.01 installation and it works fine... so unless it's an issue with a more recent version I can't see you have anything wrong here.

    Andy

  • Andrew Duff 13 posts 53 karma points
    Jul 05, 2013 @ 00:35
    Andrew Duff
    0

    Its a strange one running on Windows 8 Umbraco version v6.1.2 everything works just not SurfaceControllers. I have noticed within the source of the error there's more hidden information within the HTML. Looks like something a little more underlying is happening.

    Thanks

    Andy

     <!-- 
    [HttpException]: The controller for path &#39;/umbraco/Surface/UtilsSurface/GetAddress/&#39; was not found or does not implement IController.
       at System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType)
       at System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName)
       at System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory)
       at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)
       at Umbraco.Web.Mvc.UmbracoMvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)
       at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    -->
  • Dan White 206 posts 510 karma points c-trib
    Jul 29, 2013 @ 02:53
    Dan White
    0

    @Andrew

    Did you find a solution to this? I'm having the same problem.

    Thanks

  • Zain 3 posts 23 karma points
    May 20, 2014 @ 08:38
    Zain
    0

    Any update? I am also facing the error.

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    May 20, 2014 @ 08:57
    Dave Woestenborghs
    0

    have you tried calling the action from your template with @Html.Action("GetAddress","UtilsSurface")

    Dave

  • Juhi Paunikar 8 posts 53 karma points
    May 20, 2014 @ 13:06
    Juhi Paunikar
    0

    Hi,

    I have route path in Global.asax.cs

              routes.MapRoute(
             "Login",
             "MySurface/Login/{username}/{isRemember}",
             new { Controller = "MySurface", action = "Login", username = "", isRemember = "" }
     );
    

    Then using this for ajax call like

       var  newURL = window.location.protocol + "//" + window.location.host + "/MySurface/Login/" + username + "/" + isRemember + "?password="+password;
    

    It's Working fine.

    Thanks,

    Juhi Paunikar

Please Sign in or register to post replies

Write your reply to:

Draft