Per the instructions in the docs I have created a MySurfaceController class and saved it in /controllers. Created a html layout in /views/my/index.cshtml
Then try to request:
umbraco.local/umbraco/surface/my/
which results in an IIS 404 (staticfile handler).
What else should I do? I tried this both on 6.0.0 and 6.1.0. beta 2.
Thanks sebas. I have the standard global.asax. But after fiddling around a bit more I found out that the URL syntax is a little different than documented and it is not picking up default actions. So I'm able to request the web api using this syntax:
Notice the extra Api appended to the controller name and also the mandatory action name at the end (Post). Should I file this as a bug or am I misundertanding something about the URL syntax?
I haven't had success with directly requesting the SurfaceController using the same technique though:
I've also had a look at your Umbraco6Example project. I now understand more about how the Surface controllers work and how they are hooked up using Html.BeginUmbracoForm. Would be great though if you could add a demonstration of how to use the new Localization API's so that I can solve this problem too.
SurfaceController results in 404 IIS page
Per the instructions in the docs I have created a MySurfaceController class and saved it in /controllers. Created a html layout in /views/my/index.cshtml
Then try to request:
umbraco.local/umbraco/surface/my/
which results in an IIS 404 (staticfile handler).
What else should I do? I tried this both on 6.0.0 and 6.1.0. beta 2.
Are you using your own global.asax? It should inherit from Umbraco.Web.UmbracoApplication.
Other than that, in a clean install this works.
Make sure to check out my (very much work in progress) v6 examples site: https://github.com/nul800sebastiaan/Umbraco6Examples
It shows you better ways of mixing umbraco and controllers/views.
Basically: If you need a form to be handled by a controller:
Thanks sebas. I have the standard global.asax. But after fiddling around a bit more I found out that the URL syntax is a little different than documented and it is not picking up default actions. So I'm able to request the web api using this syntax:
http://umbraco.local/Umbraco/Api/MyApi/Post
Notice the extra Api appended to the controller name and also the mandatory action name at the end (Post). Should I file this as a bug or am I misundertanding something about the URL syntax?
I haven't had success with directly requesting the SurfaceController using the same technique though:
http://umbraco.local/Umbraco/Surface/MySurface/Index
Doesnt' work. But then maybe it is not supposed to be requested directly as per your example project.
I've also had a look at your Umbraco6Example project. I now understand more about how the Surface controllers work and how they are hooked up using Html.BeginUmbracoForm. Would be great though if you could add a demonstration of how to use the new Localization API's so that I can solve this problem too.
Have you manage to solve this problem? I'm having the same but my surfacecotroller works fine in my dev environment but on production it gives a 404
You need to have the namespace in your controller.
This will not work
but this will
If you have umbraco v6 the routing will work without the namespace, but umbraco v7 for some reason requires it.
is working on a reply...