The place URL you refer to does not have an action specified. You're calling a parameterless action called "London".
If you go https://(sitename)/currenttimefor/place/london and you have an action named Place, it should work just as well as the Location one.
This is pure MVC stuff and not Umbraco stuff, btw. ;)
MVC style route mapping
I'm trying to get my head around getting MVC type routing...
This works fine, and the url looks like: https://(sitename)/currenttimefor/location/51.507222;-0.1275
Now I'd also would like to have this for named places, like: https://(sitename)/currenttimefor/london
But can't find any working code for this, how much I try.
(I'm using a class that inherits from UmbracoApplication, to map the route.)
Hi Ulf,
Is this code using .net WebApi (eg. intended to return JSON or XML) or is it using MVC returning a HTML view?
Thanks,
Jamie
It returns JSON (JsonResponse) in a MVC-application inside Umbraco.
The place URL you refer to does not have an action specified. You're calling a parameterless action called "London". If you go https://(sitename)/currenttimefor/place/london and you have an action named Place, it should work just as well as the Location one.
This is pure MVC stuff and not Umbraco stuff, btw. ;)
Well, that one works, but not as intended, since the "/place/" part should'n be in the url... That one I can manage to get right. :)
Then you'll need to configure two different routes:
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.