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?
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
What version of Umbraco and can you post the code for your controller?
Have you created your view in the ~/Views/{controllername} folder?
Greg.
Hi greg,
It was my mistake I was leaving the 'Surface' part out the controller name in the url.
Thanks
LJ
is working on a reply...