Menu.DynamicItemFormatString プロパティ
アセンブリ: System.Web (system.web.dll 内)

Dim instance As Menu Dim value As String value = instance.DynamicItemFormatString instance.DynamicItemFormatString = value
/** @property */ public String get_DynamicItemFormatString () /** @property */ public void set_DynamicItemFormatString (String value)
public function get DynamicItemFormatString () : String public function set DynamicItemFormatString (value : String)
すべてのメニュー項目と共に表示される追加のテキストまたは文字。このプロパティの既定値は "{0}" です。

このプロパティを使用してテキストを挿入し、モバイル デバイスに表示されるメニューの動的メニュー項目の書式を設定できます。Menu コントロールは、静的メニュー項目と動的メニュー項目の表示用テンプレートをサポートします。モバイル デバイスではテンプレートは無視されるため、このプロパティを使用して文字やテキストを追加し、テンプレートを使用せずにメニュー項目に書式設定を適用できます。
![]() |
---|
このプロパティを使用するときに一貫した書式設定を実現するために、静的メニュー項目と動的メニュー項目の書式設定を同じにする場合は、StaticItemFormatString プロパティも設定する必要があります。 |
テンプレートの書式設定とこのプロパティの両方が適用されている場合、モバイル デバイスではテンプレートの書式設定が無視されます。

StaticItemFormatString プロパティと DynamicItemFormatString プロパティを使用して、各メニュー項目にテキストを追加する方法のコード例を次に示します。
<%@ Page Language="VB" %> <html> <body> <form 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="C#" %> <html> <body> <form 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>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からMenu.DynamicItemFormatString プロパティを検索する場合は、下記のリンクをクリックしてください。

- Menu.DynamicItemFormatString プロパティのページへのリンク