Hi all,
I'm stuck with a problem of which I can not imagine I am the first person having to deal with it. Yet, Google comes up with nothing useful and neither does SO, so here I am.
I'm using ASP.NET MVC1 with a sitemap. Using an html helper I create a navigation menu that highlights the current selected option in the Site.Master page. Common scenario and easily done by using :
foreach ( SiteMapNode subnode in node.ChildNodes) {
if (SiteMap.CurrentNode == subnode) { //got ourselves the current here }
}
That's all fine and dandy, however, my problem is that I have 1 controller with multiple actions. Consider the following scenario:
Accounts * clients * suppliers * maintainance
They would all be in my AccountController, doing a search that is identical but with a different AccountTypeId value.
When I read the SiteMap.CurrentNode value it gives me merely the info that I am using the AccountController, but not which action I called. I've tried a whole bunch of things but I can not get the action that was requested.
I hope I gave enough info there to give you an idea of the scenario. If you need anything else, let me know.
Thanks in advance :)!
PS: Tossed into asp.net since about 2 months here at work so bear with me. Programming experience is here but C# / .NET knowledge is mostly equal to what Google or co-workers can provide me with.
EDIT: -- In response to bob's answer below --
I have came across the SiteMap Provider project however I didn't gave it much attention since I'm using MVC1 and it's aimed at MVC2. Additionally, I'm not quite sure if we are already using it or not...After all, I have a sitemap... And the person who could tell me at the office is chillin' on a beach somewhere for the next 2 weeks :(