I am developing a site using Umbraco and so far it has been great. Unfortunately, I have been struggling for days with something and reading lot's of things but I can't get it to work. Also, I'm confused about the direction to take.
So, I thought I would ask. What I need is to have an endpoint to which I can do a GET request trough ajax and get back custom "event" data as json. The "events" are just content nodes in my umbraco installation.
The json will then be used client side to render the specific presentation I need.
This seems like basic stuff and that Umbraco totally supports it, but I can't get it. So, my questions:
Should I use a Surface Controller or an Api Controller. What's the difference? Is Api a replacement for Surface but both are still supported for the time being?
Where should I place my controller class? This isn't mentioned anywhere.
Do I need to declare my controller anywhere to make it available?
I have tried both controller types and keep getting 404's.
I'm using Umbraco 7.1.8 on Windows 7 and IIS 7.5. VS2013 .NET4.5 and Umbraco was installed using nuget.
I had already read that. I agree that seems the way to go, but the docuemnt doesn't give me much detail. For example, where should I create the controller? I'm working in a local installation done through nuget in VS2013.
blocked implementing api endpoint with controller
Hi all,
I am developing a site using Umbraco and so far it has been great. Unfortunately, I have been struggling for days with something and reading lot's of things but I can't get it to work. Also, I'm confused about the direction to take.
So, I thought I would ask. What I need is to have an endpoint to which I can do a GET request trough ajax and get back custom "event" data as json. The "events" are just content nodes in my umbraco installation.
The json will then be used client side to render the specific presentation I need.
This seems like basic stuff and that Umbraco totally supports it, but I can't get it. So, my questions:
Hi German
To me it sounds like you should have a look at using WebAPI, which you can read more about here https://our.umbraco.org/documentation/Reference/WebApi/
Hope this helps.
/Jan
Hi Jan,
Thanks for the reply.
I had already read that. I agree that seems the way to go, but the docuemnt doesn't give me much detail. For example, where should I create the controller? I'm working in a local installation done through nuget in VS2013.
Thanks,
Germán
is working on a reply...