Copied to clipboard

Flag this post as spam?

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


  • Jan Molbech 40 posts 126 karma points
    Aug 13, 2014 @ 08:27
    Jan Molbech
    0

    Installed Umbraco 7 but where are the controllers?

    I've followed this http://our.umbraco.org/documentation/Installation to make a new umbraco 7 installation, and it works, but looking at at my project stucture in Visual Studio i can't find the controllers.

     

    Where are they?

     

  • Dan Lister 416 posts 1974 karma points c-trib
    Aug 13, 2014 @ 09:08
    Dan Lister
    0

    Hi Jan,

    If you have installed a empty Umbraco solution, you will have to create your own controllers and controllers folder. Using Visual Studio, create a controllers folder in the root of your web site and then create a new controller. You should inherit the class from the SurfaceControllers class.

    Thanks, Dan.

  • Jan Molbech 40 posts 126 karma points
    Aug 13, 2014 @ 09:55
    Jan Molbech
    0

    Done that and i've also added routing to the Global.asax but it is still not working.

    My controller is inheriting from RenderMvcController not Surfacecontroller.

    Is there some routing setting in web.config that i have to update or anything else?

    EDIT: When i call my controller i get a 404 from Umbraco. The controller is never called.

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Aug 13, 2014 @ 13:06
    Sebastiaan Janssen
    100

    You might benefit from reading how to work with MVC in Umbraco as described in this blog post: http://umbraco.com/follow-us/blog-archive/2013/7/14/moving-from-webforms-to-mvc.aspx

    Especially the second part (from usercontrol to surfacecontroller) shows you a full example of the way to work with MVC.

    FYI: Umbraco comes from the webforms world and likes to do it's own routing, just trying to wedge in default mvc routing is not going to work very well or at least it won't work together with Umbraco as a CMS.

Please Sign in or register to post replies

Write your reply to:

Draft