Home > Services > Products > Company
那么这些父菜单的子菜单应该显示在每个人的下方,如果我将光标悬停在Services
上它应该显示子菜单Web Designs >Website Development
等,或者它应该显示的产品HTML Metatag Extractor ,Apartment Management System
等。我怎么能这样做。现有的工作就像第一个单根节点Home
一样,如果你鼠标悬停它显示服务,产品,公司然后每个子节点相应{ p>
以下是我所做的工作 web.sitemap是
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="index.aspx" title="Home" description="Home">
<siteMapNode url="Services.aspx" title="Services" description="">
<siteMapNode url="webdesign.aspx" title="Web Designs" description="" />
<siteMapNode url="websitedevelopment.aspx" title="Website Development" description=""/>
<siteMapNode url="cmscustomization.aspx" title="CMS Customization" description="" />
<siteMapNode url="softwaredevelopment.aspx" title="Software Development" description="" />
<siteMapNode url="internetmarketing.aspx" title="Internet Marketing" description="" />
<siteMapNode url="mobiledevelopment.aspx" title="Mobile Development" description="" />
<siteMapNode url="hostingsolutions.aspx" title="Hosting Solutions" description="" />
</siteMapNode>
<siteMapNode url="products.aspx" title="Products" description="" >
<siteMapNode url="tagxtor.aspx" title="HTML Metatag Extractor" description="" />
<siteMapNode url="ams.aspx" title="Apartment Management System" description="" />
<siteMapNode url="cgnp.aspx" title="Closed Group Network Portal" description="" />
<siteMapNode url="ribbon.aspx" title="Retail Management System" description="" />
</siteMapNode>
<siteMapNode url="company.aspx" title="Company" description="" >
<siteMapNode url="aboutus.aspx" title="About Us" description="" />
<siteMapNode url="team.aspx" title="Our Team" description="" />
<siteMapNode url="career.aspx" title="Work With Us" description="" />
<siteMapNode url="contactus.aspx" title="Contact Us" description="" />
</siteMapNode>
</siteMapNode>
</siteMap>
HTML代码
<asp:Menu ID="Menu1" runat="server" StaticEnableDefaultPopOutImage="false" Orientation="Horizontal" DataSourceID="SiteMapDataSource1">
<asp:SiteMapPath ID="SiteMapPath1" runat="server" PathSeparator=">"></asp:SiteMapPath>
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
答案 0 :(得分:0)
您目前的设置方式是,Home是顶级节点,服务,产品和公司位于其下方。
你想要做这样的事情:
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="" title="Top Level" description="Top Level">
<siteMapNode url="Home.aspx" title="Home" description="" />
<siteMapNode url="Services.aspx" title="Services" description="" />
<siteMapNode url="Products.aspx" title="Products" description="" />
<siteMapNode url="Company.aspx" title="Company" description="" />
</siteMapNode>
</siteMap>
在您的SiteMapDataSource中,您将要添加一些新属性
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" StartingNodeOffset="0" ShowStartingNode="false" />
对SiteMapDataSource的此更改将忽略顶级节点并显示其下的4个节点。