Imported from the CodePlex archive for reference purposes. Support for MvcCodeRouting has ended.
Try this:
@Html.Action("UserMenu", "~~RiskPrime.Main.Default")
I think that should work, let me know.
Thanks for answering.
I actually tried that, I have the same line of code:
Html.Action("UserMenu", "~~RiskPrime.Main.Default")
But I noticed something, I will explain. So I have my login page, right after the user is logged in, I redirect him to the welcome view, the URL looks like this:
/RiskPrime/Main/Welcome
Which is fine, I have a 'Welcome' controller under that baseRoute, and there is a valid route for that, BUT, the welcome view is using the _Layout, and this layout should be rendered including the UserMenu, I try to render this menu with the line of code:
Html.Action("UserMenu", "~~RiskPrime.Main.Default")
But right after this line execution in my _layout.vbhtml, I get the error:
Message=The controller for path '/RiskPrime/Main/Welcome' was not found or does not implement IController.
Now, if I comment out that line where I am trying to render the menu, everything is fine and my Welcome page is rendered successfully.
So, in summary, it seems like the code breaks when I am opening "/RiskPrime/Main/Welcome" but at the same time trying to render a menu under "/RiskPrime/Main/UserMenu", I dont think that route is wrong, it should match both cases, it is kind of weird.
routes.MapRoute(Nothing, "RiskPrime/Main/{action}", _ New With {.controller = "Default"}, _ New With {.action = "Welcome|SilverlightMain|NoAccess|UserMenu"}, _ New String() {"SpectrumSL.Web.RiskPrime.Main"})Thanks,
I cannot reproduce the issue. I created a project that tries to recreate your routes/controllers and it works fine. If you email me at maxtoroq@gmail.com I can send it to you.
What versions of ASP.NET MVC and MvcCodeRouting are you using?