Menu.StaticItemFormatString 속성

정의

정적으로 표시되는 모든 메뉴 항목과 함께 표시되는 추가 텍스트를 가져오거나 설정합니다.

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

속성 값

모든 메뉴 항목과 함께 표시되는 추가 텍스트나 문자입니다. 이 속성의 기본값은 "{0}."

예제

다음 코드 예제를 사용 하는 방법에 설명 합니다 StaticItemFormatStringDynamicItemFormatString 각 메뉴 항목 텍스트를 추가 하는 속성입니다.


<%@ 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 StaticItemFormatString and DynamicItemFormatString Example</title>
</head>
<body>
    <form id="form1" runat="server">
    
      <h3>Menu StaticItemFormatString and DynamicItemFormatString Example</h3>
    
      <asp:menu id="NavigationMenu"
        staticdisplaylevels="1"
        staticsubmenuindent="10" 
        orientation="Vertical"
        target="_blank"  
        runat="server"
        StaticItemFormatString="To Go to: {0}"
        DynamicItemFormatString="Click here: {0}">
        
        <dynamicmenustyle backcolor="LightSkyBlue"
          forecolor="Black"
          borderstyle="Solid"
          borderwidth="1"
          bordercolor="Black" />
      
        <items>
          <asp:menuitem navigateurl="Home.aspx" 
            text="Home"
            tooltip="Home"
              Selectable="false">
            <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"
              Enabled="false">
              <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 StaticItemFormatString and DynamicItemFormatString Example</title>
</head>
<body>
    <form id="form1" runat="server">
    
      <h3>Menu StaticItemFormatString and DynamicItemFormatString Example</h3>
    
      <asp:menu id="NavigationMenu"
        staticdisplaylevels="1"
        staticsubmenuindent="10" 
        orientation="Vertical"
        target="_blank"  
        runat="server"
        StaticItemFormatString="To Go to: {0}"
        DynamicItemFormatString="Click here: {0}">
        
        <dynamicmenustyle backcolor="LightSkyBlue"
          forecolor="Black"
          borderstyle="Solid"
          borderwidth="1"
          bordercolor="Black" />
      
        <items>
          <asp:menuitem navigateurl="Home.aspx" 
            text="Home"
            tooltip="Home"
              Selectable="false">
            <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"
              Enabled="false">
              <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>

설명

메뉴에서 정적 메뉴 항목의 서식을 지정할 텍스트를 삽입 하려면이 속성을 사용할 수 있습니다. 모바일 디바이스의 경우 특히 유용합니다. Menu 컨트롤은 정적 및 동적 메뉴 항목의 표시를 위한 템플릿을 지원 하지만 템플릿을 모바일 디바이스에서 무시 됩니다. 이 속성을 사용 하 여 문자 또는 텍스트를 추가 하 고 템플릿을 사용 하지 않고 모바일 및 데스크톱 디바이스에 대 한 메뉴 항목에 서식을 적용할 수 있습니다.

참고

이 속성을 사용 하는 경우 형식 일치를 위해 설정 해야 합니다 DynamicItemFormatString 정적 및 동적 메뉴 항목 간에 동일 하 게 형식을 지정 하는 경우 속성입니다.

템플릿 서식 지정 및이 속성을 모두 적용 되며, 모바일 디바이스에 대 한 템플릿 형식이 무시 됩니다.

적용 대상

추가 정보