Copied to clipboard

Flag this post as spam?

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


  • lj 81 posts 425 karma points
    Feb 25, 2014 @ 15:03
    lj
    0

    mvc route returning 404 error

    Hi,

    Ive set up a controller which inherites from SurfaceController and added a simple action (decorated with HttpGet attribute) method that returns a string. I then from my view call @Html.Action(actionmethod, contoller) and the string is displayed on the page as expected.

    I have read that the action method is routed to '/umbraco/surface/controllername/actionmethod/'. If I navigate to this from my browser directly I am getting a 404 error. Any ideas why it is not being served up directly? Is this the correct behaviour?

    Thankks

    LJ

  • Greg Fyans 140 posts 342 karma points
    Feb 26, 2014 @ 18:09
    Greg Fyans
    0

    What version of Umbraco and can you post the code for your controller?

    Have you created your view in the ~/Views/{controllername} folder?

    Greg.

  • lj 81 posts 425 karma points
    Feb 27, 2014 @ 10:44
    lj
    100

    Hi greg,

    It was my mistake I was leaving the 'Surface'  part out the controller name in the url.

     

    Thanks

    LJ

Please Sign in or register to post replies

Write your reply to:

Draft