简体   繁体   English

Web.sitemap应该匹配任何查询字符串

[英]Web.sitemap should match any query string

My web.sitemap should match any query string. 我的web.sitemap应该匹配任何查询字符串。 If my data query string is having 100 entries then that would require one hundred site map file entries. 如果我的数据查询字符串有100个条目,则将需要一百个站点地图文件条目。 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 星号不使用任何其他通配符或正则表达式来执行此操作

The implementation of SiteMapProvider first attempts to match the URL with the query string, then attempts to match the URL without the query string. SiteMapProvider的实现首先尝试将URL与查询字符串匹配,然后尝试将URL与没有查询字符串匹配。 So, to match any query string, you just need to leave it off of your <siteMapNode> url attribute. 因此,要匹配任何查询字符串,只需将其保留在<siteMapNode> url属性之外。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM