Menu.ScrollUpImageUrl 属性

定义

获取或设置动态菜单中显示的图像的 URL,以指示用户可以向上滚动查看更多菜单项。Gets or sets the URL to an image displayed in a dynamic menu to indicate that the user can scroll up for additional menu items.

public:
 property System::String ^ ScrollUpImageUrl { System::String ^ get(); void set(System::String ^ value); };
public string ScrollUpImageUrl { get; set; }
member this.ScrollUpImageUrl : string with get, set
Public Property ScrollUpImageUrl As String

属性值

String

动态菜单中显示的图像的 URL,指示用户可以向上滚动查看更多菜单项。The URL to an image displayed in a dynamic menu to indicate that the user can scroll up for additional menu items. 默认值为空字符串 (""),指示尚未设置此属性。The default value is an empty string (""), which indicates that this property is not set.

示例

下面的代码示例演示如何使用 ScrollUpImageUrl 属性来显示自定义图像,该图像指示用户可以在动态菜单中向上滚动查看更多菜单项。The following code example demonstrates how to use the ScrollUpImageUrl property to display a custom image indicating that the user can scroll up in a dynamic menu for additional menu items.


<%@ 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>


<%@ Page Language="VB" %>

<!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>

注解

此属性在 .NET 4.0 呈现模式中不受支持。This property is not supported in the .NET 4.0 rendering mode. 如果此属性是必需的,则可以通过在页面的代码中添加以下内容,将菜单设置为 .NET 3.5 呈现模式:If this property is required, you can set the menu to the .NET 3.5 rendering mode by adding the following in the page's code:

menuInstance.RenderingCompatibility = new Version(3, 5);  

使用 ScrollUpImageUrl 属性指定要在每个动态菜单顶部显示的自定义图像,以指示用户可以向上滚动查看更多菜单项。Use the ScrollUpImageUrl property to specify a custom image to display at the top of each dynamic menu to indicate that the user can scroll up for additional menu items.

备注

如果未设置此属性,则使用内部默认图像。If this property is not set, the internal, default image is used.

可以通过设置属性来指定图像的替换文字 ScrollUpTextYou can specify alternate text for the image by setting the ScrollUpText property.

适用于

另请参阅