Menu.DynamicMenuStyle 속성

정의

동적 메뉴의 모양을 설정하는 데 사용할 수 있는 MenuItemStyle 개체에 대한 참조를 가져옵니다.

public:
 property System::Web::UI::WebControls::SubMenuStyle ^ DynamicMenuStyle { System::Web::UI::WebControls::SubMenuStyle ^ get(); };
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public System.Web.UI.WebControls.SubMenuStyle DynamicMenuStyle { get; }
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
member this.DynamicMenuStyle : System.Web.UI.WebControls.SubMenuStyle
Public ReadOnly Property DynamicMenuStyle As SubMenuStyle

속성 값

SubMenuStyle

동적 메뉴의 스타일을 나타내는 MenuItemStyle에 대한 참조입니다.

특성

예제

다음 코드 예제를 사용 하는 방법에 설명 합니다 DynamicMenuStyle 속성을 통해 동적 메뉴에 대 한 연한 하늘색 배경색을 지정 합니다.


<%@ 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 DynamicMenuStyle Example</title>
</head>
<body>
    <form id="form1" runat="server">
    
      <h3>Menu DynamicMenuStyle Example</h3>
    
      <asp:menu id="NavigationMenu"
        staticdisplaylevels="2"
        staticsubmenuindent="10" 
        orientation="Vertical"
        target="_blank"  
        runat="server">
        
        <dynamicmenustyle backcolor="LightSkyBlue"
          forecolor="Black"
          borderstyle="Solid"
          borderwidth="1"
          bordercolor="Black" />
      
        <items>
          <asp:menuitem navigateurl="Home.aspx" 
            text="Home"
            tooltip="Home">
            <asp:menuitem navigateurl="Music.aspx"
              text="Music"
              tooltip="Music">
              <asp:menuitem navigateurl="Classical.aspx" 
                text="Classical"
                tooltip="Classical"/>
              <asp:menuitem navigateurl="Rock.aspx"
                text="Rock"
                tooltip="Rock"/>
              <asp:menuitem navigateurl="Jazz.aspx"
                text="Jazz"
                tooltip="Jazz"/>
            </asp:menuitem>
            <asp:menuitem navigateurl="Movies.aspx"
              text="Movies"
              tooltip="Movies">
              <asp:menuitem navigateurl="Action.aspx"
                text="Action"
                tooltip="Action"/>
              <asp:menuitem navigateurl="Drama.aspx"
                text="Drama"
                tooltip="Drama"/>
              <asp:menuitem navigateurl="Musical.aspx"
                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 DynamicMenuStyle Example</title>
</head>
<body>
    <form id="form1" runat="server">
    
      <h3>Menu DynamicMenuStyle Example</h3>
    
      <asp:menu id="NavigationMenu"
        staticdisplaylevels="2"
        staticsubmenuindent="10" 
        orientation="Vertical"
        target="_blank"  
        runat="server">
        
        <dynamicmenustyle backcolor="LightSkyBlue"
          forecolor="Black"
          borderstyle="Solid"
          borderwidth="1"
          bordercolor="Black" />
      
        <items>
          <asp:menuitem navigateurl="Home.aspx" 
            text="Home"
            tooltip="Home">
            <asp:menuitem navigateurl="Music.aspx"
              text="Music"
              tooltip="Music">
              <asp:menuitem navigateurl="Classical.aspx" 
                text="Classical"
                tooltip="Classical"/>
              <asp:menuitem navigateurl="Rock.aspx"
                text="Rock"
                tooltip="Rock"/>
              <asp:menuitem navigateurl="Jazz.aspx"
                text="Jazz"
                tooltip="Jazz"/>
            </asp:menuitem>
            <asp:menuitem navigateurl="Movies.aspx"
              text="Movies"
              tooltip="Movies">
              <asp:menuitem navigateurl="Action.aspx"
                text="Action"
                tooltip="Action"/>
              <asp:menuitem navigateurl="Drama.aspx"
                text="Drama"
                tooltip="Drama"/>
              <asp:menuitem navigateurl="Musical.aspx"
                text="Musical"
                tooltip="Musical"/>
            </asp:menuitem>
          </asp:menuitem>
        </items>
      
      </asp:menu>

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

설명

사용 된 DynamicMenuStyle 동적 메뉴의 모양을 제어 하는 속성입니다. 이 속성은 읽기 전용입니다. 그러나의 속성을 설정할 수는 MenuItemStyle 개체를 반환 합니다. 속성 형식에서 선언적으로 설정할 수 있습니다 Property-Subproperty, 여기서 Subproperty 속성인 합니다 MenuItemStyle 개체 (예를 들어 DynamicMenuStyle-ForeColor). 형식에서 속성을 프로그래밍 방식으로 설정할 수도 있습니다 Property.Subproperty (예를 들어 DynamicMenuStyle.ForeColor).

동적 메뉴 항목에 대 한 스타일 속성은 다음 순서 대로 적용 됩니다.

  1. DynamicMenuStyle.

  2. DynamicMenuItemStyle. 경우는 LevelMenuItemStyles 컬렉션 또는 LevelSubMenuStyles 컬렉션이 정의 된, 다른 메뉴 항목 스타일 속성을 재정의이 이번에 적용 됩니다.

  3. DynamicSelectedStyle. 경우는 LevelSelectedStyles 컬렉션이 정의 된, 다른 메뉴 항목 스타일 속성을 재정의이 이번에 적용 됩니다.

  4. DynamicHoverStyle.

적용 대상

추가 정보