public class TestController : Umbraco.Web.Mvc.SurfaceController
{
public ActionResult Index()
{
var listOfNames = new List<string>() { "Warren", "Bob", "Tom" };
return Json(listOfNames, JsonRequestBehavior.AllowGet);
}
}
So i hoped to route controller as described in documentation:
Yes i have built the solution.
Seems like i have to make a new installation. But i am sure everything is perfect with routing :( Something else happens here.
Edit: after installing brand new umbraco + 1 hours of code moving and bug fixing finally i got working Custom SurfaceController.
Umbraco surface controller routing problem
Hi, I am making umbraco surface controller for ajax request. First I made Controllers folder under project. Then I added new controller class. Just followed documentation from link below. https://our.umbraco.com/documentation/reference/routing/surface-controllers
Here is my code in controller.
So i hoped to route controller as described in documentation:
But i get HTTP Error 404.0 - Not Found. I tried everything I could but no result. Umbraco version is 7.12.4. Anyone had same problem before ?
Hi Saba,
Have you ensured you have built the solution?
I dropped this code into a brand new umbraco installation and it worked fine for me
If that doesnt work, something else in your project must be interfering with the routing
Yes i have built the solution. Seems like i have to make a new installation. But i am sure everything is perfect with routing :( Something else happens here.
Edit: after installing brand new umbraco + 1 hours of code moving and bug fixing finally i got working Custom SurfaceController.
is working on a reply...