Menu.PathSeparator プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Menu.PathSeparator プロパティの意味・解説 

Menu.PathSeparator プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

Menu コントロールメニュー項目のパス区切り文字取得または設定します

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Dim instance As Menu
Dim value As Char

value = instance.PathSeparator

instance.PathSeparator = value
public char PathSeparator { get;
 set; }
public:
property wchar_t PathSeparator {
    wchar_t get ();
    void set (wchar_t value);
}
/** @property */
public char get_PathSeparator ()

/** @property */
public void set_PathSeparator (char
 value)
public function get PathSeparator
 () : char

public function set PathSeparator
 (value : char)

プロパティ
メニュー項目のパス区切り文字既定値スラッシュ (/) です。

解説解説
使用例使用例

PathSeparator プロパティ使用してメニュー項目の値パス区切り文字コンマ変更する方法コード例次に示します

<%@ Page Language="VB" %>

<script runat="server">

  Sub Page_Load(ByVal sender As
 Object, ByVal e As EventArgs)
 
    ' The value path for a menu item is a delimited list
    ' of menu text values that form a path from the root 
    ' menu item to the current menu item.

    ' Declare the value path to the Classical menu item using
    ' the delimiter character specified in the PathSeparator
    ' property. In this example, the delimiter character is a
    ' comma.
    Dim valuePath As String
 = "Home,Music,Classical"
    
    ' Use the FindItem method to get the Classical menu item using
    ' its value path.
    Dim item As MenuItem = NavigationMenu.FindItem(valuePath)
    
    ' Indicate whether the menu item was found.
    If Not item Is Nothing
 Then
    
      Message.Text = item.Text & " menu item found at depth
 " & _
        item.Depth.ToString() & "."
    
    Else
    
      Message.Text = "Menu item not found."
    
    End If
      
  End Sub
  
</script>

<html>
  <body>
    <form runat="server">
    
      <h3>Menu PathSeparator and FindItem Example</h3>
    
      <!-- Use the PathSeparator property to
  -->
      <!-- change the delimiter character for -->
      <!-- the value path of a menu item to
 a -->
      <!-- comma (,).                         -->
      <asp:menu id="NavigationMenu"
        staticdisplaylevels="2"
        staticsubmenuindent="10" 
        orientation="Vertical"
        pathseparator="," 
        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>
      
      <hr/>
      
      <asp:label id="Message" 
        runat="server"/>

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

<%@ Page Language="C#" %>

<script runat="server">

  void Page_Load(Object sender, EventArgs e)
  {
    // The value path for a menu item is a delimited list
    // of menu text values that form a path from the root 
    // menu item to the current menu item.

    // Declare the value path to the Classical menu item using
    // the delimiter character specified in the PathSeparator
    // property. In this example, the delimiter character is a
    // comma.
    String valuePath = "Home,Music,Classical";
    
    // Use the FindItem method to get the Classical menu item using
    // its value path.
    MenuItem item = NavigationMenu.FindItem(valuePath);
    
    // Indicate whether the menu item was found.
    if (item != null)
    {
      Message.Text = item.Text + " menu item found at depth " + 
        item.Depth.ToString() + ".";
    }
    else
    {
      Message.Text = "Menu item not found.";
    }
  }
  
</script>

<html>
  <body>
    <form runat="server">
    
      <h3>Menu PathSeparator and FindItem Example</h3>
    
      <!-- Use the PathSeparator property to  -->
      <!-- change the delimiter character for -->
      <!-- the value path of a menu item to a -->
      <!-- comma (,).                         -->
      <asp:menu id="NavigationMenu"
        staticdisplaylevels="2"
        staticsubmenuindent="10" 
        orientation="Vertical"
        pathseparator="," 
        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>
      
      <hr/>
      
      <asp:label id="Message" 
        runat="server"/>

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

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
Menu クラス
Menu メンバ
System.Web.UI.WebControls 名前空間
ValuePath
FindItem


このページでは「.NET Framework クラス ライブラリ リファレンス」からMenu.PathSeparator プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からMenu.PathSeparator プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からMenu.PathSeparator プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「Menu.PathSeparator プロパティ」の関連用語

Menu.PathSeparator プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Menu.PathSeparator プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS