Issue with Menu Generation (URL Parameters)

Nov 13, 2010 at 6:16 PM

I am using the latest version of the source code.  When I access a URL with a parameter specified and the page is rendered, I see that the links in the menu that are not supposed to have a parameter, now have the current parameter appended to the end of them.

Sitemap snippet:

<mvcSiteMapNode title="What's New" controller="page" action="general-info/whats-new" />
<mvcSiteMapNode title="General Information" controller="page" action="general-info" />
<mvcSiteMapNode title="Technical Information" controller="page" action="tech-info" />


Navigated URL: http://localhost:1234/page/general-info/whats-new

Menu Shows:



Any ideas on what is causing this, and possibly how to resolve it?


Nov 15, 2010 at 11:34 AM

Can you show me the route table tou are using and a snippet of PageCOntroller?

Nov 17, 2010 at 3:42 PM

How do I get the route table?



public class PageController : Controller
// GET: /Page/

public ActionResult GeneralInfo(string pageName, string subcontext = "")
var pageParam = XmlLoader.LoadPage("page""general-info", pageName, subcontext);
return View("GeneralInfo", pageParam);

public ActionResult TechInfo(string pageName, string subcontext = "")
var pageParam = XmlLoader.LoadPage("page""tech-info", pageName, subcontext);
return View("TechInfo", pageParam);



Nov 18, 2010 at 7:03 AM

The one in your global.asax.cs


Oh by the way, change <mvcSiteMapNode title="What's New" controller="page" action="general-info/whats-new" /> into <mvcSiteMapNode title="What's New" controller="page" action="general-info" />, the first one will confuce ASP.NET MVC...

Nov 18, 2010 at 3:32 PM

I know where the RouteTable is, what do you need to see?  What routes I add into it, or the routes in the RouteTable, from the property RouteTable.Routes ?

If I make the change as suggested, how can I make my menus display properly?  It needs to navigate to http://localhost:1234/page/general-info/whats-new, not http://localhost:1234/page/general-info.

Nov 19, 2010 at 9:05 AM

The routes you are adding is fine.