duplicate urls are not really duplicate

Sep 17, 2009 at 3:33 PM

Hello, I just wanted to discuss something that I think might be tossed around. The idea that  http://blah.com/Home and http://blah.com/Home/Index  are the same URLS. The way the provider handles this now is it thinks they are the same URLS when they are not. They do point to the same ACTION but they are technically not the same URL. It seems like you're manually handling the routing assumption this way when we should be able to create the routing that handles  /Home and /Home/Index ourselves.

Your thoughts?

Sep 18, 2009 at 8:03 AM

Can you post some example code?

Sep 18, 2009 at 8:53 AM

<mvcSiteMapNode title="My Page" controller="Home" >

<mvcSiteMapNode title="My Page Again" controller="Home" action="Index"/>


The first node should produce a url /Home

The second node should product a url /Home/Index

I'm not sure how you're handling this to the extent that these produce an duplicate node error, but they are technically 2 different urls that potentially point to the same action via the routing tables.


Sep 18, 2009 at 11:00 AM

We are using the route engine to create URL's, i.e.: "give me an URL for controller Home and action Index". In both cases ,routing will produce the same URL... Html.ActionLink() has the same behaviour.

Sep 18, 2009 at 12:13 PM
Edited Sep 18, 2009 at 12:47 PM

and you do this via the MvcSiteMapNode.cs Url property's getter? Is this correct?


Sep 18, 2009 at 10:52 PM

I was able to circumvent the Url construction by building my own logic to construct the Url's and checking for existence of the nodes by URL in the children node set of the root node.