I'm using Razor in MVC 4. I'm trying to make a URL from a view in an area to a controller action in another area. The following returns an empty string:
@Url.Action("Action", "MyController", new { area = "OtherArea" })
I've done some testing with other options, and the following returns a URL, but it's wrong:
@Url.Action("Action", "MyController", new { parameter = 1 })
The resulting URL is /App/IncorrectArea/My/Action?parameter=1. Note the incorrect area; Url.Action is assuming (since I didn't pass an area) that the controller lives in the current area which it does not!
Any ideas?