Orchard - link to view / action in another module?
1 answer
ASP.NET MVC links point to an action on a controller , not a view. As a result, the result can (but does not have to) return from the given action.
So if your View2 comes back eg. action MyAction on Controller2 sitting in Module2 , then you can easily add a link to this action from anywhere by writing:
@Html.ActionLink("Click Me",
"MyAction",
"Controller2",
new { area = "Module2" },
new {})
or
@Html.ActionLink("Click Me",
"MyAction",
new { controller = "Controller2", area = "Module2" })
which is best for you. There are a couple of other possible overrides .
The Route Area property is used in Orchard to specify the name of the target module.
+4
source to share