我把产品类别存在Web.SiteMap中,如下:<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
  <siteMapNode url="~/Default.aspx" title="Home" description="Home">
    <siteMapNode url="Software.aspx" title="Software"  description="Software">
        <siteMapNode url="PCSoftware.aspx" title="PC Software"  description="PC Software" />
        <siteMapNode url="MACSoftware.aspx" title="MAC Software"  description="MAC Software" />
        <siteMapNode url="OtherSoftware.aspx" title="Other"  description="Other Software" />
    </siteMapNode>
    <siteMapNode url="" title="Video Games"  description="Video Games">
      <siteMapNode url="" title="Xbox 360"  description="" />
      <siteMapNode url="" title="Playstation 3"  description="" />然后就可以使用TreeView和SiteMapPath了。当点击每个菜单项时,就会跳转到相应页面。我想,不同品种的显示只是查询范围(条件)的不同,显示格式完全一样,没有必要有那么多的页面文件。如果我只写一个Details.aspx文件,把查询条件当参数传进去,岂不方便!如下:        <siteMapNode url="Details.aspx?category=1" title="PC Software"  description="PC Software" />
        <siteMapNode url="Details.aspx?category=2" title="MAC Software"  description="MAC Software" />
        <siteMapNode url="Details.aspx?category=3" title="Other"  description="Other Software" />但这样写XML出错,提示说不允许有相同的URL。请问怎么解决这个问题?谢谢!

解决方案 »

  1.   

    那我怎么办?我想同时显示SiteMapPath:Home>Software>PC Software如果用不同的文件很简单,但是一共有50多个种类,还得建50多个对应的网页文件吗?有没有简单的办法呢?
      

  2.   

    用URL重写就可以了,
    Details.aspx?category=3
    写成:Details_3.aspx,
    还会被认为是同一个页面么?
      

  3.   

    去网上接一下url重写,非常多,down一个urlRewrite.dll放在你的Bin目录下,因为是相同的扩展名,也就不需要你到服务器上设置什么,只要在web.config里面写一下如何转发就行了。