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

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

WebPartManager.SupportedDisplayModes プロパティ

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

特定の Web ページ上で使用できるすべての表示モード読み取り専用コレクション取得します

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

Public ReadOnly Property
 SupportedDisplayModes As WebPartDisplayModeCollection
Dim instance As WebPartManager
Dim value As WebPartDisplayModeCollection

value = instance.SupportedDisplayModes
public WebPartDisplayModeCollection SupportedDisplayModes { get;
 }
public:
property WebPartDisplayModeCollection^ SupportedDisplayModes {
    WebPartDisplayModeCollection^ get ();
}
/** @property */
public WebPartDisplayModeCollection get_SupportedDisplayModes
 ()
public function get SupportedDisplayModes
 () : WebPartDisplayModeCollection

プロパティ
特定の Web ページ上で使用できる WebPartDisplayMode オブジェクトセット格納された WebPartDisplayModeCollection。

解説解説

SupportedDisplayModes プロパティには、ページ上に存在するゾーン コントロール種類指定して、そのページ実際に使用できる表示モードだけが格納されます。

メモメモ

表示モード無効にできます表示モード無効にすると、その表示モードサポート対応する種類ゾーンページ上に存在する場合でも、それは SupportedDisplayModes コレクション追加されません。

ブラウズ モードデザイン モードは常にサポートされます。サポートされない可能性のある表示モードは、編集モードカタログ モード、および接続モードです。これらの表示モードそれぞれが、特定の種類の ToolZone コントロール関連付けられます。Web ページ上に特別に指定されゾーン存在すると、SupportedDisplayModes プロパティ参照されるコレクション特定の表示モード追加されます。たとえば、Web ページに EditorZone ゾーン含まれていても CatalogZone ゾーン含まれていない場合編集表示モードはそのページサポートされますが、カタログ表示モードサポートされません。

使用例使用例

SupportedDisplayModes プロパティプログラムでの使用方法を示すコード例次に示しますコードは、このプロパティ使用して現在の Web ページ使用できる表示モードだけのリスト作成します

このページには、サポートされ表示モードとして、ブラウズデザイン、および編集3 つ存在します最初2 つは常に使用可能で、ページEditorZone コントロール含まれているため、このコード例では編集モード使用できますカタログ表示モード接続表示モードは、このページ対応するゾーンがないため表示されません。

<%@ Page Language="VB" %>

<script runat="server">

  Protected Sub Page_Init(ByVal
 sender As Object, _
    ByVal e As EventArgs)
    Dim mode As WebPartDisplayMode
    For Each mode In mgr.SupportedDisplayModes
      Dim modeName As String
 = mode.Name
      If mode.IsEnabled(mgr) Then
        Dim item As ListItem = New
 ListItem(modeName, modeName)
        DisplayModeDropdown.Items.Add(item)
      End If
    Next
    
  End Sub

  Protected Sub DisplayModeDropdown_SelectedIndexChanged(ByVal
 _
    sender As Object, ByVal
 e As EventArgs)
    Dim selectedMode As String
 = _
      DisplayModeDropdown.SelectedValue
    Dim mode As WebPartDisplayMode = _
      mgr.SupportedDisplayModes(selectedMode)
    If mode IsNot Nothing Then
      mgr.DisplayMode = mode
    End If
  End Sub
  
</script>

<html  >
<head runat="server">
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <asp:WebPartManager ID="mgr" runat="server">
      </asp:WebPartManager>
      <asp:WebPartZone ID="WebPartZone1" runat="server">
        <ZoneTemplate>
          <asp:Calendar ID="Calendar1" runat="server"
 
            Title="My Calendar" />
        </ZoneTemplate>
      </asp:WebPartZone>
      <asp:WebPartZone ID="WebPartZone2" runat="server">
        <ZoneTemplate>
          <asp:BulletedList 
            DisplayMode="HyperLink" 
            ID="BulletedList1" 
            runat="server"
            Title="My Links">
            <asp:ListItem Value="http://www.microsoft.com">
            Microsoft
            </asp:ListItem>
            <asp:ListItem Value="http://www.msn.com">
            MSN
            </asp:ListItem>
            <asp:ListItem Value="http://www.contoso.com">
            Contoso Corp.
            </asp:ListItem>
          </asp:BulletedList>
        </ZoneTemplate>
      </asp:WebPartZone>
      <asp:EditorZone ID="EditorZone1" runat="server">
        <ZoneTemplate>
          <asp:AppearanceEditorPart runat="server"
 
            ID="Appearance1">
          </asp:AppearanceEditorPart>
          <asp:LayoutEditorPart runat="server"
 ID="Layout1">
          </asp:LayoutEditorPart>
        </ZoneTemplate>
      </asp:EditorZone>
      <hr />
      <asp:DropDownList ID="DisplayModeDropdown"
 runat="server" 
        AutoPostBack="true"
        Width="120"
        OnSelectedIndexChanged=
        "DisplayModeDropdown_SelectedIndexChanged">
      </asp:DropDownList>
    </div>
    </form>
</body>
</html>
<%@ Page Language="C#" %>

<script runat="server">

  protected void Page_Init(object sender, EventArgs
 e)
  {
    foreach (WebPartDisplayMode mode in mgr.SupportedDisplayModes)
    {
      string modeName = mode.Name;
      if (mode.IsEnabled(mgr))
      {
        ListItem item = new ListItem(modeName, modeName);
        DisplayModeDropdown.Items.Add(item);
      }      
    }
  }

  protected void DisplayModeDropdown_SelectedIndexChanged(object
 
    sender, EventArgs e)
  {
    String selectedMode = DisplayModeDropdown.SelectedValue;
    WebPartDisplayMode mode = 
      mgr.SupportedDisplayModes[selectedMode];
    if (mode != null)
      mgr.DisplayMode = mode;
  }
  
</script>

<html  >
<head runat="server">
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <asp:WebPartManager ID="mgr" runat="server">
      </asp:WebPartManager>
      <asp:WebPartZone ID="WebPartZone1" runat="server">
        <ZoneTemplate>
          <asp:Calendar ID="Calendar1" runat="server" 
            Title="My Calendar" />
        </ZoneTemplate>
      </asp:WebPartZone>
      <asp:WebPartZone ID="WebPartZone2" runat="server">
        <ZoneTemplate>
          <asp:BulletedList 
            DisplayMode="HyperLink" 
            ID="BulletedList1" 
            runat="server"
            Title="My Links">
            <asp:ListItem Value="http://www.microsoft.com">
            Microsoft
            </asp:ListItem>
            <asp:ListItem Value="http://www.msn.com">
            MSN
            </asp:ListItem>
            <asp:ListItem Value="http://www.contoso.com">
            Contoso Corp.
            </asp:ListItem>
          </asp:BulletedList>
        </ZoneTemplate>
      </asp:WebPartZone>
      <asp:EditorZone ID="EditorZone1" runat="server">
        <ZoneTemplate>
          <asp:AppearanceEditorPart runat="server" 
            ID="Appearance1">
          </asp:AppearanceEditorPart>
          <asp:LayoutEditorPart runat="server" ID="Layout1">
          </asp:LayoutEditorPart>
        </ZoneTemplate>
      </asp:EditorZone>
      <hr />
      <asp:DropDownList ID="DisplayModeDropdown" runat="server"
 
        AutoPostBack="true"
        Width="120"
        OnSelectedIndexChanged=
        "DisplayModeDropdown_SelectedIndexChanged">
      </asp:DropDownList>
    </div>
    </form>
</body>
</html>

ブラウザページ読み込んだ後、ドロップダウン リスト コントロール使用してブラウズ モードからデザイン モードページ切り替え次に編集モード切り替えることができます編集モードで、サーバー コントロール1 つヘッダーにあるドロップダウンの動詞メニュークリックし、[編集] を選択してコントロール編集します

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS