Oct 22, 2012 at 1:05 PM
Edited Oct 22, 2012 at 3:23 PM
As subject, is it possible to programatically select which navigation items are highlighted from a custom controller?
Thanks in advance for any replies.
I found a way to hack this to work after a little debugging, but it's very dirty.
var routeData = Request.RequestContext.RouteData;
routeData.Values["area"] = "Contents";
routeData.Values["controller"] = "Item";
routeData.Values["action"] = "Display";
routeData.Values["Id"] = "105";
inside my controller, where the route values match the required navigation node, but this meant adding a corresponding view at Item/Display.cshtml inside my area.
There has to be a better way. Any ideas?