Html.ActionLink Action Straggler
I have a nav menu with links structured like so:
<div class="childLinkGroup">
<div
class="headerLink">@Html.ActionLink("Engine
Products", null, "EngineProducts", null,
null)</div>
<ul>
<li>@Html.ActionLink("Perkins
Engines", "PerkinsEngines",
"EngineProducts", null, null)</li>
<li>@Html.ActionLink("Isuzu Engines",
"IsuzuEngines", "EngineProducts",
null, null)</li>
<li>@Html.ActionLink("FPT PowerTrain",
"FPTPowerTrain", "EngineProducts",
null, null)</li>
<li>@Html.ActionLink("Mitsubishi
Engines", "MitsubishiEngines",
"EngineProducts", null, null)</li>
</ul>
</div>
These all work fine when accessed from the homepage.
If you're already on a child page like /EngineProducts/IsuzuEngines and
try to access a different parent level link like /TransmissionProducts the
IsuzuEngines is left on the link resulting in a page that can't be found.
There's a bunch of overrides for Html.ActionLink and while I looked though
them I don't see a different set of params that looks better.
No comments:
Post a Comment