Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I've had a site dumped on my which uses Umbraco which I know nothing about and am now stuck....
I have a page controller called ManageYourList which works fine when I go to <site url>/manage-your-list (intentional inclusion and exclusion of the hyphens - I don't know why it works).
In said controller there is an action called Index. This too works.
I have a form which posts to an action in surface controller called ManageYourList / DoLogin and this works just fine.
My problem though is that I have another action (put in both controllers out of desperation) called DoLogout and if I type <site url>/manage-your-list/dologout then it does not work. I've tried all incarnations (except the one which works obviously ;) )
The action has no post or get decorations on it. If I do a quick form I can post to it though - just never a get.
Not knowing much about Umbraco I cannot understand why this is handled like this and what I need to do to correct it.
Please help - I send this from the roof-top edge :S
If you haven't really used Umbraco before, I'd suggest reading up on something called SurfaceControllers and how to implement them within your Umbraco solution. You might find this page helpful, specifically the sections relating to creating SurfaceController actions and using BeginUmbracoForm.
SurfaceControllers are an extension of normal Controllers with some extra added Umbraco goodness which includes automatic routing to your actions. The BeginUmbracoController will help you set up your form correctly so your submit path is always correct.
Thanks for the reply.
I can get forms to work - there is no issue there. What I am struggling with is to get a normal url-to-action to work.
So, if I have a controller called test and an action called me I should normally be able to have a URL which just goes to test/me and that should work shouldn't it? This does not appear to be the case with Umbraco in the mix. That's what is confusing me.
I think you'll want to inherit your controller from UmbracoApiController. A controller inherited of that class should be automatically routed and accessed via /umbraco/api/controllername/action. See documentation here.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted