How do I use something like Url.Action with webapi's?

Topics: Administration, General, Writing modules
Sep 4, 2014 at 6:39 PM
I posted this on orchardpro's be got no reponse....


On a view using razor I can do the following:

@Url.Action("Index", "Dashboard", new { area = "MyModule" })

this works great! I would like to do this in a few other use cases:

In a razor view but have it return a webapi url, so maybe it would look like this:
@Url.Action("Get", "User", new { area = "MyWebApi" })

In a webapi controller I would like to return a url and use something like: Url.Action("Index", "Dashboard", new { area = "MyModule" })
but this does not exist in a webapi controller.

Thanks in advance for any suggestions
Developer
Sep 16, 2014 at 5:17 AM
Hi Rob, I saw your ticket on Orchard Pros, but unfortunately I don't know the answer off hand. Would you be so kind to provide links to both posts when cross posting? Thanks!
Sep 16, 2014 at 5:51 AM
Sorry spike, wasn't sure what to do about my ticket on orchard pro's when it expired.


http://orchardpros.net/tickets/4510
Developer
Sep 16, 2014 at 6:02 AM
No worries, thanks for linking. Hopefully someone can help you out.