none
微软的Menu控件中,为什么ScrollUpImageUrl和ScrollDownImageUrl所指示滚动图片总是不显示?包括“帮助文档”中的示例程序也是! RRS feed

  • 问题

  • 关于“帮助文档”中Menu.ScrollDownImageUrl 属性的示例程序如下:

     

    <%@ Page Language="C#" %>

    <!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>Menu Example</title>
    </head>
    <body>
        <form id="form1" runat="server">

          <h3>Menu Example</h3>

          <asp:menu id="NavigationMenu"
            staticdisplaylevels="2"
            staticsubmenuindent="10"
            orientation="Vertical"
            ScrollDownImageUrl="Images\ScrollDownImage.jpg"
            ScrollDownText="Down"
            ScrollUpImageUrl="Images\ScrollUpImage.jpg"
            ScrollUpText="Up"
            runat="server">

            <dynamicmenustyle Height="50"/>

            <items>
              <asp:menuitem text="Home">
                <asp:menuitem text="Category 1">
                  <asp:menuitem text="Item 1"/>
                  <asp:menuitem text="Item 2"/>
                  <asp:menuitem text="Item 3"/>
                  <asp:menuitem text="Item 4"/>
                  <asp:menuitem text="Item 5"/>
                  <asp:menuitem text="Item 6"/>
                  <asp:menuitem text="Item 7"/>
                  <asp:menuitem text="Item 8"/>
                  <asp:menuitem text="Item 9"/>
                  <asp:menuitem text="Item 10"/>
                </asp:menuitem>
              </asp:menuitem>
            </items>

          </asp:menu>

        </form>
      </body>
    </html>

    我对ScrollDownImageUrl的理解是:

    当菜单项列表超过指定高度不能完全显示出来的时候,在菜单底部将会出现“ScrollDownImageUrl”所指的滚动图标,然后鼠标放上去,该菜单列表将会向下滚动。
    效果其实就和VS工具中,调试断点的代码的时候对某个对象的查看那样。

    不知道是我的理解有偏差,还是什么问题?

    谢谢!

    2010年4月15日 7:13

答案

  • <%@ Page Language="C#" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
    
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
      <title></title>
    </head>
    <body>
      <form id="form1" runat="server">
      <div>
       <h2>
        Basic Menu Control with Menu Item Collection</h2>
       This sample shows basic Menu functionality when the Menu Items are stored as a 
       collection of items within the control. Although this sample demonstrates a 
       navigation scenario, the Menu control can be used in non-navigation scenarios, 
       for example selecting your city from a list of regions.
       <br />
       <br />
       <asp:Menu ID="Menu1" runat="server" BackColor="#FFFBD6" DynamicHorizontalOffset="2"
        Font-Names="Verdana" ForeColor="#990000" StaticSubMenuIndent="10px" orientation="Vertical" >
        <Items>
         <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Book 0" Value="Book 0" />
         <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Book 1" Value="Book 1">
          <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Chapter 0" Value="Chapter 0" />
          <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Chapter 1" Value="Chapter 1">
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1" />
          </asp:MenuItem>
         </asp:MenuItem>
         <asp:MenuItem Text="Book 2" Value="Book 2">
          <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Chapter 0" Value="Chapter 0" />
          <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Chapter 1" Value="Chapter 1">
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1" />
          </asp:MenuItem>
          <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Chapter 2" Value="Chapter 2">
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 2" Value="Page 2" />
          </asp:MenuItem>
         </asp:MenuItem>
         <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Book 3" Value="Book 3">
          <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Chapter 0" Value="Chapter 0" />
          <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Chapter 1" Value="Chapter 1">
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1" />
          </asp:MenuItem>
          <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Chapter 2" Value="Chapter 2">
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 2" Value="Page 2" />
          </asp:MenuItem>
          <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Chapter 3" Value="Chapter 3">
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 2" Value="Page 2" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 3" Value="Page 3" />
            <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 2" Value="Page 2" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 3" Value="Page 3" />
            <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 2" Value="Page 2" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 3" Value="Page 3" />
            <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 2" Value="Page 2" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 3" Value="Page 3" />
            <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 2" Value="Page 2" />
            <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 2" Value="Page 2" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 3" Value="Page 3" />
            <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 2" Value="Page 2" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 3" Value="Page 3" />
            <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 2" Value="Page 2" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 3" Value="Page 3" />
            <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 2" Value="Page 2" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 3" Value="Page 3" />
            <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 2" Value="Page 2" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 3" Value="Page 3" />
            <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 2" Value="Page 2" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 3" Value="Page 3" />
            <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 2" Value="Page 2" />
            <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 2" Value="Page 2" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 3" Value="Page 3" />
            <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 2" Value="Page 2" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 3" Value="Page 3" />
            <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 2" Value="Page 2" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 3" Value="Page 3" />
            <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 2" Value="Page 2" />
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 3" Value="Page 3" />
           
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 3" Value="Page 3" />
           
           <asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 3" Value="Page 3" />
          </asp:MenuItem>
         </asp:MenuItem>
        </Items>
       <StaticSelectedStyle BackColor="#FFCC66" />
        <StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
        <DynamicMenuStyle BackColor="#FFFBD6" />
        <DynamicSelectedStyle BackColor="#FFCC66" />
        <DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
        <DynamicHoverStyle BackColor="#990000" Font-Bold="False" ForeColor="White" />
        <StaticHoverStyle BackColor="#990000" Font-Bold="False" ForeColor="White" />
        <DynamicMenuItemStyle Height="20"/>
       </asp:Menu>
       <br />
       <br />
       <b>Note:</b> All items in the Menu point to the same page to simplify the sample.
       </div>
    
    
    
      </form>
    </body>
    </html>
    

    你好,

    试试下面代码。

     


    Microsoft Online Community Support
    2010年4月19日 3:11