请教网站地图的问题
我把产品类别存在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。请问怎么解决这个问题?谢谢!