日期:2014-05-17  浏览次数:20407 次

Menu控件无法显示二级子菜单
本帖最后由 redsmoke007 于 2012-03-13 21:22:29 编辑
我觉得我的代码没错啊???
Default.aspx:
   
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
</head>
<body >
    <form id="form1" runat="server">
    <div>
    
        <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
        <br />
        <asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1">
        </asp:Menu>
    
    </div>
    </form>
</body>
</html>



Web.sitemap:
<?xml version="1.0" encoding="utf-8" ?>

<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
  <siteMapNode title="Home" description="Home Page" url="Default.aspx">
    <siteMapNode title="News" description="The Latest News" url="News.aspx">
      <siteMapNode title="U.S." description="U.S. News"
       url="News.aspx?cat=us" />
      <siteMapNode title="World" description="World News"
       url="News.aspx?cat=world" />
      <siteMapNode title="Technology" description="Technology News"
       url="News.aspx?cat=tech" />
      <siteMapNode title="Sports" description="Sports News"
       url="News.aspx?cat=sport" />
    </siteMapNode>
    <siteMapNode title="Finance" description="The Latest Financial Information"
      url="Finance.aspx">
      <siteMapNode title="Quotes" description="Get the Latest Quotes"