Menu.ScrollUpText 屬性

定義

取得或設定 ScrollUpImageUrl 屬性中所指定影像的替代文字。

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

屬性值

ScrollUpImageUrl 屬性中所指定影像的替代文字。 預設為空字串 (""),表示這個屬性未設定。

範例

下列程式碼範例示範如何使用 ScrollUpText 屬性來指定影像的替代文字,以指出使用者可以在動態功能表中捲動其他功能表項目。


<%@ 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 轉譯模式不支援此屬性。 如果需要此屬性,您可以在頁面的程式碼中新增下列內容,將功能表設定為 .NET 3.5 轉譯模式:

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

當動態功能表項目包含功能表頂端的其他專案時,會顯示影像,指出使用者可以向上捲動以檢視其他功能表項目。 ScrollUpText使用 屬性來指定此影像的替代文字。 您指定的文字會提供輔助技術裝置的描述,這些影像可用來讓控制項更容易存取。

當設定時,此屬性的值可以使用設計工具自動儲存到資源檔。 如需詳細資訊,請參閱 LocalizableAttribute和全球化和當地語系化

適用於

另請參閱