Copied to clipboard

Flag this post as spam?

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


  • Ahmed Ilyas 7 posts 27 karma points
    Jan 28, 2014 @ 03:40
    Ahmed Ilyas
    0

    Typical "how do I?" - use my own controllers/views

    I am TOTALLY new to umbraco and unfortunately been thrown into the deep end to try and get this working.

    So, I have my own existing MVC site. A simple site with a controller called "MyAddressController" with its view and model.

     

    The view itself show data from the model but also has a JQuery AJAX call to get data from the controller. This works fine.

     

    I now installed umbraco 7.0.3 in VS2012 using the Nugut system. I am using MVC4 C#.

    I setup Umbraco using all defaults and using an empty SQL Server DB. All is fine.

     

    Now, the question is... how the heck can I go to my view? Right now I get a page could not be found where as before installing Umbraco, it was working fine.

    I know Umbraco takes over the routing.

    Currently as it stands, I have an MVC project in a solution, I installed Umbraco 7.0.3 using the Nuget package. Now what?

    I want to be able to show the views as before OR within Umbraco. At the same time I don't really want all the AJAX calls to break.

     

    can someone kindly help me? I'm having a hard time trying to understand.

     

    thank you.

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jan 28, 2014 @ 08:10
    Dennis Aaen
    0

    Hi Ahmed

    This documentation about custom routes and custom controllers might help:

    http://our.umbraco.org/documentation/Reference/Mvc/custom-routes

    http://our.umbraco.org/documentation/Reference/Mvc/custom-controllers

    Here is also a blog post from yesterday, with an example of how to use custom routes and custom controllers.

    http://umbraco.com/follow-us/blog-archive/2014/1/27/a-practical-example-of-route-hijacking-in-umbraco.aspx

    /Dennis

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Jan 28, 2014 @ 12:12
    Jeroen Breuer
    0

    Hello,

    Dennis his posts are a good start. If you want to know more about MVC and Umbraco check the Hybrid Framework.

    Jeroen

  • Krishna 22 posts 52 karma points
    Feb 03, 2014 @ 19:04
    Krishna
    0

    I found using MVC areas for custom controllers and views easy and clean. You will have to register the area though using the application start up event.  

Please Sign in or register to post replies

Write your reply to:

Draft