tahirjadoon — 2012-04-24T15:59:39-04:00 — #1
I have a route as
This points to
So, how do i get the actual page path that is currently displaying as
wwb_99 — 2012-04-24T16:36:18-04:00 — #2
What is the "actual page path" -- as far as everything is concerned, the route is the path.
tahirjadoon — 2012-04-24T16:40:57-04:00 — #3
the route points to /SomeArea/SomeController/SomeAction
Now the layout also calls some helper actions from inside the /controllers/home to build common pieces.
wwb_99 — 2012-04-25T10:20:58-04:00 — #4
First, you have a very bad understanding of routing -- it does not point to a url but rather to specific classes and methods on that class. The default routing URL structure only exists because it is in the default template. You can't just "get the route" like that.
Anyhow, there are a few ways to skin this beast. The most elegant would be to sue the MVC futures and the Html.RenderAction<T> extensions, that will let you render a specific controller action in a strongly-typed manner. If you can't do that, you can pretty easily pass in the appropriate hashes for route parameters and it will find the controller.
tahirjadoon — 2012-04-25T10:43:18-04:00 — #5
Thanks. I will update as soon as i have some thing in place.
mittineague — 2014-09-17T23:12:27-04:00 — #6
This topic is now archived. It is frozen and cannot be changed in any way.