Menu.ScrollUpText Proprietà

Definizione

Ottiene o imposta il testo alternativo per l'immagine specificata nella proprietà 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

Valore della proprietà

Testo alternativo dell'immagine specificata nella proprietà ScrollUpImageUrl. Il valore predefinito è una stringa vuota (""), a indicare che questa proprietà non è impostata.

Esempio

Nell'esempio di codice seguente viene illustrato come utilizzare la ScrollUpText proprietà per specificare il testo alternativo per l'immagine utilizzata per indicare che l'utente può scorrere verso l'alto in un menu dinamico per voci di menu aggiuntive.


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

Commenti

Questa proprietà non è supportata nella modalità di rendering di .NET 4.0. Se questa proprietà è obbligatoria, è possibile impostare il menu sulla modalità di rendering .NET 3.5 aggiungendo quanto segue nel codice della pagina:

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

Quando una voce di menu dinamica contiene voci aggiuntive nella parte superiore del menu, viene visualizzata un'immagine per indicare che l'utente può scorrere verso l'alto per visualizzare voci di menu aggiuntive. Utilizzare la ScrollUpText proprietà per specificare il testo alternativo per questa immagine. Il testo specificato fornisce dispositivi di assistive technology con una descrizione dell'immagine che può essere usata per rendere il controllo più accessibile.

Il valore di questa proprietà, se impostato, può essere salvato automaticamente in un file di risorse usando uno strumento di progettazione. Per altre informazioni, vedere LocalizableAttribute Globalizzazione e localizzazione.

Si applica a

Vedi anche