WebPartZoneCollection コンストラクタ ()
アセンブリ: System.Web (system.web.dll 内)


WebPartManager コントロールは、このコンストラクタを、それ自体のコンストラクタ内で使用して、Web パーツ ページの WebPartZoneCollection クラスの新しいインスタンスを初期化します。

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


WebPartZoneCollection クラス
WebPartZoneCollection メンバ
System.Web.UI.WebControls.WebParts 名前空間
その他の技術情報
ASP.NET Web パーツ ページ
ASP.NET Web パーツ ページ
WebPartZoneCollection コンストラクタ (ICollection)
アセンブリ: System.Web (system.web.dll 内)

- webPartZones
WebPartZone オブジェクトの ICollection。


WebPartZone オブジェクトのカスタム コレクションを作成し、それに対してプログラムによって操作を実行する場合に、WebPartZoneCollection コンストラクタを使用します。たとえば、Zones プロパティにアクセスし、Web パーツ ページの WebPartZone オブジェクトのサブセットを WebPartZoneCollection オブジェクトに割り当てて作成し、ゾーンのそのサブセットだけの子コントロールまたは各種プロパティに対して操作を実行できます。

WebPartZoneCollection コンストラクタの使用方法を次のコード例に示します。この例の完全なコードは、WebPartZoneCollection の概要にある「例」のセクションを参照してください。
コードの次のセクションでは、Zones プロパティの値を取得することによって、WebPartZoneCollection オブジェクトを変数に割り当てています。必要な場合は、Zones プロパティからすべてのゾーンを割り当てるのではなく、ページのすべてのゾーンのサブセットを格納する WebPartZoneBase オブジェクトの配列を作成し、その配列を新しい WebPartZoneCollection オブジェクトに割り当てることができます。
Protected Sub Button5_Click(ByVal sender As Object, ByVal e As EventArgs) Label1.Text = String.Empty Dim zoneCollection As WebPartZoneCollection = mgr.Zones Dim zone As WebPartZone For Each zone In zoneCollection If zone.WebPartVerbRenderMode = WebPartVerbRenderMode.Menu Then zone.WebPartVerbRenderMode = WebPartVerbRenderMode.TitleBar Else zone.WebPartVerbRenderMode = WebPartVerbRenderMode.Menu End If Next zone End Sub
protected void Button5_Click(object sender, EventArgs e) { Label1.Text = String.Empty; WebPartZoneCollection zoneCollection = mgr.Zones; foreach (WebPartZone zone in zoneCollection) { if (zone.WebPartVerbRenderMode == WebPartVerbRenderMode.Menu) zone.WebPartVerbRenderMode = WebPartVerbRenderMode.TitleBar; else zone.WebPartVerbRenderMode = WebPartVerbRenderMode.Menu; } }
コレクションを作成した後は、コレクションを反復処理して、格納されているすべてのゾーンまたはその内容に対して操作を実行できます。プログラム例を実行するには、ブラウザにページを読み込み、各ゾーンの [Toggle Verb Render Mode] ボタンをクリックします。これによって、ゾーン内の各サーバー コントロールのタイトル バーの動詞の表示方法が変更されます。動詞は、ドロップダウン メニューに、またはタイトル バーに直接リンクとして表示できます。

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


WebPartZoneCollection コンストラクタ
WebPartZoneCollection コンストラクタは、WebPartManager コントロール、Web パーツ コントロール セット内の他のコントロール、またはカスタムの開発者のコードによって、Web パーツ ページ上に存在する WebPartZone コントロールの読み取り専用のコレクションを作成するために使用されます。
ASP.NET Web パーツ ページ
名前 | 説明 |
---|---|
WebPartZoneCollection () | WebPartZoneCollection クラスの空のインスタンスを初期化します。 |
WebPartZoneCollection (ICollection) | WebPartZoneCollection クラスのインスタンスを、WebPartZone オブジェクトのコレクションを渡すことによって初期化します。 |

関連項目
WebPartZoneCollection クラスWebPartZoneCollection メンバ
System.Web.UI.WebControls.WebParts 名前空間
その他の技術情報
ASP.NET Web パーツ ページASP.NET Web パーツ ページ
- WebPartZoneCollection コンストラクタ ()のページへのリンク