in the SiteMap control i am using, I want 2 or more of my nodes to point to the same page.
<siteMapNode url="~/Default.aspx" title="Home" description="Home page">
<siteMapNode url="~/SectionList.aspx" title="By section" description="List of sections">
<siteMapNode url="~/BrowsePublications.aspx" title="publications of section" description="Publications of section"/>
</siteMapNode>
<siteMapNode url="~/Officers.aspx" title="By responsible officer" description="List of officers">
<siteMapNode url="~/BrowsePublications.aspx" title="publications of officer" description="Publications of officer"/>
</siteMapNode>
</siteMapNode>
I basically have a grid to show, this grid can be filtered in many ways. Each filter is a page where the user clicks a certain entry and gets redirected to the page showing the grid with data relevant to that entry. I am using query string parameters to achieve that. I read online that one way to overcome this limitation is to append dummy parameters or a '#' to the end of the urls of the duplicate nodes, so i tried with this
<siteMapNode url="~/Default.aspx" title="Home" description="Home page">
<siteMapNode url="~/SectionList.aspx" title="By section" description="List of sections">
<siteMapNode url="~/BrowsePublications.aspx?view=2" title="Publication view 1" description="Publication view"/>
</siteMapNode>
<siteMapNode url="~/Officers.aspx" title="By responsible officer" description="List of officers">
<siteMapNode url="~/BrowsePublications.aspx?view=3" title="Publication view" description="Publication view"/>
</siteMapNode>
</siteMapNode>
and also using hashes, but since i am redirecting to BrowsePublications.aspx with query parametrs, ( my url is something like
BrowsePublications.aspx?view=2&c=24
asp.net did not recognize it and i got an exception when i tried accessing SiteMap.CurrentNode from BrowsePublications.aspx What is the easiest way to achieve this. thanks
I struggled for a while to do what you have asked. There is an effective and easier way to have 2 same urls(with different query strings) in different sitemap nodes. Thought to post the solution so that anyone in future would benefit from it.
Firstly you need a parent node and a parent parent node already present in the sitemap.
///Add this event handler to the master page.