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.

適用於

另請參閱