Share via


Menu.SkipLinkText 屬性

定義

取得或設定隱藏影像的替代文字,讓螢幕助讀程式讀取以提供略過連結清單的能力。

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

屬性值

隱藏影像的替代文字,讓螢幕助讀程式讀取以提供略過連結清單的能力。 預設為空字串 (""),表示這個屬性未設定。

範例

下列程式碼範例示範如何使用 SkipLinkText 屬性來指定螢幕助讀程式讀取之隱藏影像的替代文字,以提供略過連結清單的能力。


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

      <asp:menu id="NavigationMenu"
        staticdisplaylevels="2"
        staticsubmenuindent="10" 
        orientation="Vertical"
        skiplinktext="Skip Menu" 
        runat="server">
      
        <items>
          <asp:menuitem text="Home"
            tooltip="Home">
            <asp:menuitem text="Music"
              tooltip="Music">
              <asp:menuitem text="Classical"
                tooltip="Classical"/>
              <asp:menuitem text="Rock"
                tooltip="Rock"/>
              <asp:menuitem text="Jazz"
                tooltip="Jazz"/>
            </asp:menuitem>
            <asp:menuitem text="Movies"
              tooltip="Movies">
              <asp:menuitem text="Action"
                tooltip="Action"/>
              <asp:menuitem text="Drama"
                tooltip="Drama"/>
              <asp:menuitem text="Musical"
                tooltip="Musical"/>
            </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 SkipLinkText Example</title>
</head>
<body>
    <form id="form1" runat="server">
    
      <h3>Menu SkipLinkText Example</h3>

      <asp:menu id="NavigationMenu"
        staticdisplaylevels="2"
        staticsubmenuindent="10" 
        orientation="Vertical"
        skiplinktext="Skip Menu" 
        runat="server">
      
        <items>
          <asp:menuitem text="Home"
            tooltip="Home">
            <asp:menuitem text="Music"
              tooltip="Music">
              <asp:menuitem text="Classical"
                tooltip="Classical"/>
              <asp:menuitem text="Rock"
                tooltip="Rock"/>
              <asp:menuitem text="Jazz"
                tooltip="Jazz"/>
            </asp:menuitem>
            <asp:menuitem text="Movies"
              tooltip="Movies">
              <asp:menuitem text="Action"
                tooltip="Action"/>
              <asp:menuitem text="Drama"
                tooltip="Drama"/>
              <asp:menuitem text="Musical"
                tooltip="Musical"/>
            </asp:menuitem>
          </asp:menuitem>
        </items>
      
      </asp:menu>

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

備註

SkipLinkText使用 屬性可指定螢幕助讀程式讀取之隱藏影像的替代文字,以提供略過連結清單的能力。 您指定的文字會提供輔助技術裝置,並說明可用來讓控制項更容易存取的隱藏略過連結影像。

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

控制項 Menu 提供 SkipLinkText 屬性,讓螢幕助讀程式略過整個控制項。 SkipLinkText如果已設定 屬性,則會轉譯具有替代文字的不可見影像,讓使用者選擇跳到控制項的結尾。 螢幕助讀程式會大聲讀取替代文字,而影像只佔用一個圖元空間。 如需頁面轉譯的圖元精確控制,請將 SkipLinkText 屬性設定為空字串 (「」) ,並提供您自己的機制略過功能表。 屬性 SkipLinkText 預設會設定為空字串。

適用於

另請參閱