Web.sitemap should match any query string

442 Views Asked by At

My web.sitemap should match any query string. If my data query string is having 100 entries then that would require one hundred site map file entries. Is there any short cut method to do this ?

Like-

  <siteMapNode url="allvideo.aspx?data=Dancing" title="Dancing" >

        <siteMapNode url="alonevideo.aspx?data=*&amp;selected=*" title="abc" />
      </siteMapNode>
  <siteMapNode url="allvideo.aspx?data=Acting" title="" >
        <siteMapNode url="alonevideo.aspx?data=*&amp;selected=*" title="xyz" />
      </siteMapNode>

asterisk is not working any other wildcard or regex to do this

1

There are 1 best solutions below

2
NightOwl888 On

The implementation of SiteMapProvider first attempts to match the URL with the query string, then attempts to match the URL without the query string. So, to match any query string, you just need to leave it off of your <siteMapNode> url attribute.

<siteMapNode url="allvideo.aspx?data=Dancing" title="Dancing" >
    <siteMapNode url="alonevideo.aspx" title="abc" />
</siteMapNode>