ConnectionsZone クラス

定義

WebPart と、WebPartZoneBase ゾーンにある他のサーバー コントロールとの間の接続をユーザーが確立できるようにするユーザー インターフェイス (UI) を提供します。

public ref class ConnectionsZone : System::Web::UI::WebControls::WebParts::ToolZone
public class ConnectionsZone : System.Web.UI.WebControls.WebParts.ToolZone
type ConnectionsZone = class
    inherit ToolZone
Public Class ConnectionsZone
Inherits ToolZone
継承

次のコード例は、Web パーツ ページで コントロールを使用する ConnectionsZone 方法を示しています。 この例には、次の 4 つの部分があります。

  • Web ページで表示モードを切り替えるユーザー コントロール。

  • ZIP コード インターフェイスのコードと、プロバイダーと接続のコンシューマーとして機能する 2 つの WebPart コントロールを含むソース ファイル。

  • すべてのコントロールをホストし、要素を宣言 <asp:connectionszone> する方法を示し、宣言的およびプログラムによって接続ゾーンに多数のプロパティを設定する Web ページ。

  • ブラウザーでのこの例の動作の説明。

このコード例の最初の部分は、ユーザーが Web ページで表示モードを切り替えできるようにするユーザー コントロールです。 このコントロールの表示モードとソース コードの説明の詳細については、「 チュートリアル: Web パーツ ページでの表示モードの変更」を参照してください。

<%@ control language="C#" classname="DisplayModeMenuCS"%>
<script runat="server">
  
 // Use a field to reference the current WebPartManager.
  WebPartManager _manager;

  void Page_Init(object sender, EventArgs e)
  {
    Page.InitComplete += new EventHandler(InitComplete);
  }  

  void InitComplete(object sender, System.EventArgs e)
  {
    _manager = WebPartManager.GetCurrentWebPartManager(Page);

    String browseModeName = WebPartManager.BrowseDisplayMode.Name;

    // Fill the dropdown with the names of supported display modes.
    foreach (WebPartDisplayMode mode in _manager.SupportedDisplayModes)
    {
      String modeName = mode.Name;
      // Make sure a mode is enabled before adding it.
      if (mode.IsEnabled(_manager))
      {
        ListItem item = new ListItem(modeName, modeName);
        DisplayModeDropdown.Items.Add(item);
      }
    }

    // If shared scope is allowed for this user, display the scope-switching
    // UI and select the appropriate radio button for the current user scope.
    if (_manager.Personalization.CanEnterSharedScope)
    {
      Panel2.Visible = true;
      if (_manager.Personalization.Scope == PersonalizationScope.User)
        RadioButton1.Checked = true;
      else
        RadioButton2.Checked = true;
    }
    
  }
 
  // Change the page to the selected display mode.
  void DisplayModeDropdown_SelectedIndexChanged(object sender, EventArgs e)
  {
    String selectedMode = DisplayModeDropdown.SelectedValue;

    WebPartDisplayMode mode = _manager.SupportedDisplayModes[selectedMode];
    if (mode != null)
      _manager.DisplayMode = mode;
  }

  // Set the selected item equal to the current display mode.
  void Page_PreRender(object sender, EventArgs e)
  {
    ListItemCollection items = DisplayModeDropdown.Items;
    int selectedIndex = 
      items.IndexOf(items.FindByText(_manager.DisplayMode.Name));
    DisplayModeDropdown.SelectedIndex = selectedIndex;
  }

  // Reset all of a user's personalization data for the page.
  protected void LinkButton1_Click(object sender, EventArgs e)
  {
    _manager.Personalization.ResetPersonalizationState();
  }

  // If not in User personalization scope, toggle into it.
  protected void RadioButton1_CheckedChanged(object sender, EventArgs e)
  {
    if (_manager.Personalization.Scope == PersonalizationScope.Shared)
      _manager.Personalization.ToggleScope();
  }

  // If not in Shared scope, and if user is allowed, toggle the scope.
  protected void RadioButton2_CheckedChanged(object sender, EventArgs e)
  {
    if (_manager.Personalization.CanEnterSharedScope && 
        _manager.Personalization.Scope == PersonalizationScope.User)
      _manager.Personalization.ToggleScope();
  }
</script>
<div>
  <asp:Panel ID="Panel1" runat="server" 
    Borderwidth="1" 
    Width="230" 
    BackColor="lightgray"
    Font-Names="Verdana, Arial, Sans Serif" >
    <asp:Label ID="Label1" runat="server" 
      Text=" Display Mode" 
      Font-Bold="true"
      Font-Size="8"
      Width="120" 
      AssociatedControlID="DisplayModeDropdown"/>
    <asp:DropDownList ID="DisplayModeDropdown" runat="server"  
      AutoPostBack="true" 
      Width="120"
      OnSelectedIndexChanged="DisplayModeDropdown_SelectedIndexChanged" />
    <asp:LinkButton ID="LinkButton1" runat="server"
      Text="Reset User State" 
      ToolTip="Reset the current user's personalization data for the page."
      Font-Size="8" 
      OnClick="LinkButton1_Click" />
    <asp:Panel ID="Panel2" runat="server" 
      GroupingText="Personalization Scope"
      Font-Bold="true"
      Font-Size="8" 
      Visible="false" >
      <asp:RadioButton ID="RadioButton1" runat="server" 
        Text="User" 
        AutoPostBack="true"
        GroupName="Scope" OnCheckedChanged="RadioButton1_CheckedChanged" />
      <asp:RadioButton ID="RadioButton2" runat="server" 
        Text="Shared" 
        AutoPostBack="true"
        GroupName="Scope" 
        OnCheckedChanged="RadioButton2_CheckedChanged" />
    </asp:Panel>
  </asp:Panel>
</div>
<%@ control language="vb" classname="DisplayModeMenuVB"%>
<script runat="server">
  ' Use a field to reference the current WebPartManager.
  Dim _manager As WebPartManager

  Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs)
    AddHandler Page.InitComplete, AddressOf InitComplete
  End Sub

  Sub InitComplete(ByVal sender As Object, ByVal e As System.EventArgs)
    _manager = WebPartManager.GetCurrentWebPartManager(Page)
      
    Dim browseModeName As String = WebPartManager.BrowseDisplayMode.Name
      
    ' Fill the dropdown with the names of supported display modes.
    Dim mode As WebPartDisplayMode
    For Each mode In _manager.SupportedDisplayModes
      Dim modeName As String = mode.Name
      ' Make sure a mode is enabled before adding it.
      If mode.IsEnabled(_manager) Then
        Dim item As New ListItem(modeName, modeName)
        DisplayModeDropdown.Items.Add(item)
      End If
    Next mode
      
    ' If shared scope is allowed for this user, display the scope-switching
    ' UI and select the appropriate radio button for the current user scope.
    If _manager.Personalization.CanEnterSharedScope Then
      Panel2.Visible = True
      If _manager.Personalization.Scope = PersonalizationScope.User Then
        RadioButton1.Checked = True
      Else
        RadioButton2.Checked = True
      End If
    End If
   
  End Sub

  ' Change the page to the selected display mode.
  Sub DisplayModeDropdown_SelectedIndexChanged(ByVal sender As Object, _
    ByVal e As EventArgs)
    
    Dim selectedMode As String = DisplayModeDropdown.SelectedValue   
    Dim mode As WebPartDisplayMode = _
      _manager.SupportedDisplayModes(selectedMode)
    If Not (mode Is Nothing) Then
      _manager.DisplayMode = mode
    End If

  End Sub
   
  ' Set the selected item equal to the current display mode.
  Sub Page_PreRender(ByVal sender As Object, ByVal e As EventArgs)
    Dim items As ListItemCollection = DisplayModeDropdown.Items
    Dim selectedIndex As Integer = _
      items.IndexOf(items.FindByText(_manager.DisplayMode.Name))
    DisplayModeDropdown.SelectedIndex = selectedIndex

  End Sub

  ' Reset all of a user's personalization data for the page.
  Protected Sub LinkButton1_Click(ByVal sender As Object, _
    ByVal e As EventArgs)
    
    _manager.Personalization.ResetPersonalizationState()
    
  End Sub

  ' If not in User personalization scope, toggle into it.
  Protected Sub RadioButton1_CheckedChanged(ByVal sender As Object, _
    ByVal e As EventArgs)
    
    If _manager.Personalization.Scope = PersonalizationScope.Shared Then
      _manager.Personalization.ToggleScope()
    End If

  End Sub
   
  ' If not in Shared scope, and if user is allowed, toggle the scope.
  Protected Sub RadioButton2_CheckedChanged(ByVal sender As Object, _
    ByVal e As EventArgs)
    
    If _manager.Personalization.CanEnterSharedScope AndAlso _
      _manager.Personalization.Scope = PersonalizationScope.User Then
      _manager.Personalization.ToggleScope()
    End If

  End Sub

</script>
<div>
  <asp:Panel ID="Panel1" runat="server" 
    Borderwidth="1" 
    Width="230" 
    BackColor="lightgray"
    Font-Names="Verdana, Arial, Sans Serif" >
    <asp:Label ID="Label1" runat="server" 
      Text=" Display Mode" 
      Font-Bold="true"
      Font-Size="8"
      Width="120" 
      AssociatedControlID="DisplayModeDropdown"/>
    <asp:DropDownList ID="DisplayModeDropdown" runat="server"  
      AutoPostBack="true" 
      Width="120"
      OnSelectedIndexChanged="DisplayModeDropdown_SelectedIndexChanged" />
    <asp:LinkButton ID="LinkButton1" runat="server"
      Text="Reset User State" 
      ToolTip="Reset the current user's personalization data for the page."
      Font-Size="8" 
      OnClick="LinkButton1_Click" />
    <asp:Panel ID="Panel2" runat="server" 
      GroupingText="Personalization Scope"
      Font-Bold="true"
      Font-Size="8" 
      Visible="false" >
      <asp:RadioButton ID="RadioButton1" runat="server" 
        Text="User" 
        AutoPostBack="true"
        GroupName="Scope" OnCheckedChanged="RadioButton1_CheckedChanged" />
      <asp:RadioButton ID="RadioButton2" runat="server" 
        Text="Shared" 
        AutoPostBack="true"
        GroupName="Scope" 
        OnCheckedChanged="RadioButton2_CheckedChanged" />
    </asp:Panel>
  </asp:Panel>
</div>

この例の 2 番目の部分は、インターフェイスとカスタム コントロールを含むソース ファイルです。 コントロールが インターフェイスをZipCodeWebPartIZipCode実装し、 属性をConnectionProvider追加して、コントロールが接続のプロバイダーとして機能できることに注意してください。 WeatherWebPartコントロールには、 属性でConnectionConsumerマークされたメソッドがあり、そこでインターフェイスがIZipCode使用されるため、接続でコンシューマーとして機能できます。

コード例を実行するには、このソース コードをコンパイルする必要があります。 明示的にコンパイルし、結果のアセンブリを Web サイトの Bin フォルダーまたはグローバル アセンブリ キャッシュに配置できます。 または、ソース コードをサイトの App_Code フォルダーに配置して、実行時に動的にコンパイルすることもできます。 この例では、動的コンパイルを使用します。 コンパイル方法を示すチュートリアルについては、「 チュートリアル: カスタム Web サーバー コントロールの開発と使用」を参照してください。

namespace Samples.AspNet.CS.Controls
{
  using System;
  using System.Web;
  using System.Web.Security;
  using System.Security.Permissions;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  using System.Web.UI.WebControls.WebParts;

  [AspNetHostingPermission(SecurityAction.Demand,
    Level = AspNetHostingPermissionLevel.Minimal)]
  [AspNetHostingPermission(SecurityAction.InheritanceDemand,
    Level = AspNetHostingPermissionLevel.Minimal)]
  public interface IZipCode
  {
    string ZipCode { get; set;}
  }

  [AspNetHostingPermission(SecurityAction.Demand,
    Level = AspNetHostingPermissionLevel.Minimal)]
  [AspNetHostingPermission(SecurityAction.InheritanceDemand,
    Level = AspNetHostingPermissionLevel.Minimal)]
  public class ZipCodeWebPart : WebPart, IZipCode
  {
    string zipCodeText = String.Empty;
    TextBox input;
    Button send;

    public ZipCodeWebPart()
    {
    }

    // Make the implemented property personalizable to save 
    // the Zip Code between browser sessions.
    [Personalizable()]
    public virtual string ZipCode
    {
      get { return zipCodeText; }
      set { zipCodeText = value; }
    }

    // This is the callback method that returns the provider.
    [ConnectionProvider("Zip Code Provider", "ZipCodeProvider")]
    public IZipCode ProvideIZipCode()
    {
      return this;
    }

    protected override void CreateChildControls()
    {
      Controls.Clear();
      input = new TextBox();
      this.Controls.Add(input);
      send = new Button();
      send.Text = "Enter 5-digit Zip Code";
      send.Click += new EventHandler(this.submit_Click);
      this.Controls.Add(send);
    }

    private void submit_Click(object sender, EventArgs e)
    {
      if (!string.IsNullOrEmpty(input.Text))
      {
        zipCodeText = Page.Server.HtmlEncode(input.Text);
        input.Text = String.Empty;
      }
    }
  }

  [AspNetHostingPermission(SecurityAction.Demand,
    Level = AspNetHostingPermissionLevel.Minimal)]
  [AspNetHostingPermission(SecurityAction.InheritanceDemand,
    Level = AspNetHostingPermissionLevel.Minimal)]
  public class WeatherWebPart : WebPart
  {
    private IZipCode _provider;
    string _zipSearch;
    Label DisplayContent;

    // This method is identified by the ConnectionConsumer 
    // attribute, and is the mechanism for connecting with 
    // the provider. 
    [ConnectionConsumer("Zip Code Consumer", "ZipCodeConsumer")]
    public void GetIZipCode(IZipCode Provider)
    {
      _provider = Provider;
    }
    
    protected override void OnPreRender(EventArgs e)
    {
      EnsureChildControls();

      if (this._provider != null)
      {
        _zipSearch = _provider.ZipCode.Trim();
        DisplayContent.Text = "My Zip Code is:  " + _zipSearch;
      }
    }

    protected override void CreateChildControls()
    {
      Controls.Clear();
      DisplayContent = new Label();
      this.Controls.Add(DisplayContent);
    }
  }
}
Imports System.Web
Imports System.Web.Security
Imports System.Security.Permissions
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts

Namespace Samples.AspNet.VB.Controls

  <AspNetHostingPermission(SecurityAction.Demand, _
    Level:=AspNetHostingPermissionLevel.Minimal)> _
  <AspNetHostingPermission(SecurityAction.InheritanceDemand, _
    Level:=AspNetHostingPermissionLevel.Minimal)> _
  Public Interface IZipCode

    Property ZipCode() As String

  End Interface

  <AspNetHostingPermission(SecurityAction.Demand, _
    Level:=AspNetHostingPermissionLevel.Minimal)> _
  <AspNetHostingPermission(SecurityAction.InheritanceDemand, _
    Level:=AspNetHostingPermissionLevel.Minimal)> _
  Public Class ZipCodeWebPart
    Inherits WebPart
    Implements IZipCode
    Private zipCodeText As String = String.Empty
    Private input As TextBox
    Private send As Button

    Public Sub New()
    End Sub

    ' Make the implemented property personalizable to save 
    ' the Zip Code between browser sessions.
    <Personalizable()> _
    Public Property ZipCode() As String _
      Implements IZipCode.ZipCode

      Get
        Return zipCodeText
      End Get
      Set(ByVal value As String)
        zipCodeText = value
      End Set
    End Property

    ' This is the callback method that returns the provider.
    <ConnectionProvider("Zip Code Provider", "ZipCodeProvider")> _
    Public Function ProvideIZipCode() As IZipCode
      Return Me
    End Function


    Protected Overrides Sub CreateChildControls()
      Controls.Clear()
      input = New TextBox()
      Me.Controls.Add(input)
      send = New Button()
      send.Text = "Enter 5-digit Zip Code"
      AddHandler send.Click, AddressOf Me.submit_Click
      Me.Controls.Add(send)

    End Sub


    Private Sub submit_Click(ByVal sender As Object, _
      ByVal e As EventArgs)

      If input.Text <> String.Empty Then
        zipCodeText = Page.Server.HtmlEncode(input.Text)
        input.Text = String.Empty
      End If

    End Sub

  End Class

  <AspNetHostingPermission(SecurityAction.Demand, _
    Level:=AspNetHostingPermissionLevel.Minimal)> _
  <AspNetHostingPermission(SecurityAction.InheritanceDemand, _
    Level:=AspNetHostingPermissionLevel.Minimal)> _
  Public Class WeatherWebPart
    Inherits WebPart
    Private _provider As IZipCode
    Private _zipSearch As String
    Private DisplayContent As Label

    ' This method is identified by the ConnectionConsumer 
    ' attribute, and is the mechanism for connecting with 
    ' the provider. 
    <ConnectionConsumer("Zip Code Consumer", "ZipCodeConsumer")> _
    Public Sub GetIZipCode(ByVal Provider As IZipCode)
      _provider = Provider
    End Sub


    Protected Overrides Sub OnPreRender(ByVal e As EventArgs)
      EnsureChildControls()

      If Not (Me._provider Is Nothing) Then
        _zipSearch = _provider.ZipCode.Trim()
                DisplayContent.Text = "My Zip Code is:  " + _zipSearch
      End If

    End Sub

    Protected Overrides Sub CreateChildControls()
      Controls.Clear()
      DisplayContent = New Label()
      Me.Controls.Add(DisplayContent)

    End Sub

  End Class

End Namespace

コード例の 3 番目の部分は Web ページです。 上部には、 Register ユーザー コントロールのディレクティブと、接続で使用されるカスタム コントロールがあります。 <asp:connectionszone>要素は、 コントロールを宣言的に使用する例として、ページでConnectionsZone宣言されています。 要素内では、多数のプロパティが宣言によって設定されます。 接続ゾーンのその他のプロパティは、ページの セクションでプログラムによって <script> 設定されます。

<%@ Page Language="C#" %>
<%@ register tagprefix="uc1" 
    tagname="DisplayModeMenuCS"
    src="~/displaymodemenucs.ascx" %>
<%@ Register TagPrefix="aspSample" 
    Namespace="Samples.AspNet.CS.Controls" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

  protected void Page_PreRender(object sender, EventArgs e)
  {
     // Set properties on verbs.
     connectionsZone1.CancelVerb.Description = 
       "Terminates the connection process";
     connectionsZone1.CloseVerb.Description = 
       "Closes the connections UI";
     connectionsZone1.ConfigureVerb.Description =
       "Configure the transformer for the connection";
     connectionsZone1.ConnectVerb.Description =
       "Connect two WebPart controls";
     connectionsZone1.DisconnectVerb.Description =
       "End the connection between two controls";
    
     // Set properties for UI text strings.
     connectionsZone1.ConfigureConnectionTitle = 
       "Configure";
     connectionsZone1.ConnectToConsumerInstructionText = 
       "Choose a consumer connection point";
     connectionsZone1.ConnectToConsumerText = 
       "Select a consumer for the provider to connect with";
     connectionsZone1.ConnectToConsumerTitle = 
       "Send data to this consumer";
     connectionsZone1.ConnectToProviderInstructionText =
       "Choose a provider connection point";
     connectionsZone1.ConnectToProviderText =
       "Select a provider for the consumer to connect with";
     connectionsZone1.ConnectToProviderTitle =
       "Get data from this provider";
     connectionsZone1.ConsumersInstructionText = 
       "WebPart controls that receive data from providers";
     connectionsZone1.ConsumersTitle = "Consumer Controls";
     connectionsZone1.GetFromText = "Receive from";
     connectionsZone1.GetText = "Retrieve";
     connectionsZone1.HeaderText = 
      "Create and Manage Connections";
     connectionsZone1.InstructionText = 
      "Manage connections for the selected WebPart control";
     connectionsZone1.InstructionTitle = 
       "Manage connections for consumers or providers";
     connectionsZone1.NoExistingConnectionInstructionText = 
       "No connections exist. Click the above link to create "
       + "a connection.";
     connectionsZone1.NoExistingConnectionTitle = 
       "No current connections";
     connectionsZone1.ProvidersInstructionText =
       "WebPart controls that send data to consumers";
     connectionsZone1.ProvidersTitle = "Provider controls";
     
  }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Connection Zone Sample</title>
</head>
<body>
  <form id="form1" runat="server">
  <asp:webpartmanager runat="server" id="mgr">
    <staticconnections>
      <asp:webpartconnection id="connection1" 
        consumerconnectionpointid="ZipCodeConsumer"
        consumerid="zipConsumer"
        providerconnectionpointid="ZipCodeProvider" 
        providerid="zipProvider" />
    </staticconnections>
  </asp:webpartmanager>
  <uc1:displaymodemenucs id="menu1" runat="server" />
  <div>
  <asp:webpartzone id="WebPartZone1" runat="server">
    <zonetemplate>
      <aspsample:zipcodewebpart id="zipProvider" runat="server" 
        Title="Zip Code Provider"  />
      <aspsample:weatherwebpart id="zipConsumer" runat="server" 
        Title="Zip Code Consumer" />
    </zonetemplate>
  </asp:webpartzone>
  <asp:connectionszone id="connectionsZone1" runat="server" >
    <cancelverb text="Terminate" />
    <closeverb text="Close Zone" />
    <configureverb text="Configure" />
    <connectverb text="Connect Controls" />
    <disconnectverb text="End Connection" />
  </asp:connectionszone>
  </div>
  </form>
</body>
</html>
<%@ Page Language="VB" %>
<%@ register tagprefix="uc1" 
    tagname="DisplayModeMenuVB"
    src="~/displaymodemenuvb.ascx" %>
<%@ Register TagPrefix="aspSample" 
    Namespace="Samples.AspNet.VB.Controls" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

  Protected Sub Page_PreRender(ByVal sender As Object, _
    ByVal e As System.EventArgs)
    
    ' Set properties for verbs.
    connectionsZone1.CancelVerb.Description = _
      "Terminates the connection process"
    connectionsZone1.CloseVerb.Description = _
      "Closes the connections UI"
    connectionsZone1.ConfigureVerb.Description = _
      "Configure the transformer for the connection"
    connectionsZone1.ConnectVerb.Description = _
      "Connect two WebPart controls"
    connectionsZone1.DisconnectVerb.Description = _
      "End the connection between two controls"
    
    ' Set properties for UI text strings.
    connectionsZone1.ConfigureConnectionTitle = _
      "Configure a new connection"
    connectionsZone1.ConnectToConsumerInstructionText = _
      "Choose a consumer connection point"
    connectionsZone1.ConnectToConsumerText = _
      "Select a consumer for the provider to connect with"
    connectionsZone1.ConnectToConsumerTitle = _
      "Send data to this consumer"
    connectionsZone1.ConnectToProviderInstructionText = _
      "Choose a provider connection point"
    connectionsZone1.ConnectToProviderText = _
      "Select a provider for the consumer to connect with"
    connectionsZone1.ConnectToProviderTitle = _
      "Get data from this provider"
    connectionsZone1.ConsumersInstructionText = _
      "WebPart controls that receive data from providers"
    connectionsZone1.ConsumersTitle = "Consumer Controls"
    connectionsZone1.GetFromText = "Receive from"
    connectionsZone1.GetText = "Retrieve"
    connectionsZone1.HeaderText = _
      "Create and Manage Connections"
    connectionsZone1.InstructionText = _
      "Manage connections for the selected WebPart control"
    connectionsZone1.InstructionTitle = _
      "Manage connections for consumers or providers"
    connectionsZone1.NoExistingConnectionInstructionText = _
      "No connections exist. Click the above link to create " _
      & "a connection."
    connectionsZone1.NoExistingConnectionTitle = _
      "No current connections"
    connectionsZone1.ProvidersInstructionText = _
      "WebPart controls that send data to consumers"
    connectionsZone1.ProvidersTitle = "Provider controls"

  End Sub

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Connection Zone Sample</title>
</head>
<body>
  <form id="form1" runat="server">
  <asp:webpartmanager runat="server" id="mgr">
    <staticconnections>
      <asp:webpartconnection id="connection1" 
        consumerconnectionpointid="ZipCodeConsumer"
        consumerid="zipConsumer"
        providerconnectionpointid="ZipCodeProvider" 
        providerid="zipProvider" />
    </staticconnections>
  </asp:webpartmanager>
  <uc1:displaymodemenuvb id="menu1" runat="server" />
  <div>
  <asp:webpartzone id="WebPartZone1" runat="server">
    <zonetemplate>
      <aspsample:zipcodewebpart id="zipProvider" runat="server" 
        Title="Zip Code Provider" />
      <aspsample:weatherwebpart id="zipConsumer" runat="server" 
        Title="Zip Code Consumer" />
    </zonetemplate>
  </asp:webpartzone>
  <asp:connectionszone id="connectionsZone1" runat="server" >
    <cancelverb text="Terminate" />
    <closeverb text="Close Zone" />
    <configureverb text="Configure" />
    <connectverb text="Connect Controls" />
    <disconnectverb text="End Connection" />
  </asp:connectionszone>
  </div>
  </form>
</body>
</html>

ブラウザーで Web ページを読み込みます。 [表示モード] ドロップダウン リスト コントロールを使用して、ページを接続モードに切り替えます。 ZIP コード プロバイダー コントロールの動詞メニュー (動詞メニューはコントロールのタイトル バーの下向き矢印で示されます) で、動詞の接続をクリックします。 コントロールが ConnectionsZone 表示されます。 接続 UI では、[ 接続の終了 ] ボタンが表示されることに注意してください。接続はページのマークアップで既に宣言されているため、コントロールは既に接続されています。 [ 接続の終了] をクリックし、 表示モード コントロールをもう一度使用して、ページを参照モードに戻します。 次に、もう一度接続モードに戻り、いずれかのコントロールで接続動詞をクリックし、接続 UI にハイパーリンクが表示され、コントロール間の接続を形成できるようになりました。 リンクをクリックし、接続 UI を使用して接続ポイントを選択し、接続を確立します。

注釈

Web パーツ コントロール セットを使用すると、2 つのサーバー コントロールを有効にして接続を形成し、データを共有できます。1 つのコントロールはプロバイダーとして機能し、もう 1 つはデータのコンシューマーとして機能します。 2 つのコントロールは WebPart 、接続を処理するように設計されており、ゾーン内に存在する場合は、コントロールまたはその他の種類の WebPartZoneBase サーバー コントロールにすることができます。 Web パーツ接続の詳細については、「および クラスのWebPartConnectionConnectionPoint概要」および「Web パーツ接続の概要」を参照してください。

Web パーツ接続を形成するために必要なコントロールと条件が存在する場合でも、コントロールを実際に接続する必要があります。 サーバー コントロール間の接続を形成するには、3 つの方法があります。Web ページでの接続の宣言、コードでの接続の作成、またはユーザーが必要に応じてコントロールを接続できるようにページにコントロールを追加 ConnectionsZone する方法です。 コントロールは ConnectionsZone 、ユーザーが接続を形成するために必要な条件を満たすページ上のサーバー コントロールを接続または切断できるようにする UI を生成します。 これは、接続を形成する必要のない省略可能なコントロールですが、接続または切断されるサーバー コントロールをユーザーに制御させる場合に便利です。

コントロールは ConnectionsZone 、基本クラスから継承する Web パーツ ツール ゾーン コントロールの ToolZone 1 つです。 ツール ゾーンとして、 ConnectionsZone コントロールは Web ページが特定の表示モードの場合にのみ表示されるように設計されています。 この場合、表示モードは接続モードという名前になります (ページ上のコントロールのプロパティ値が にConnectDisplayMode設定されている場合WebPartManagerDisplayModeページはこのモードになります)。 ユーザーは、ページを接続モードに切り替えた後、いずれかのサーバー コントロールの動詞メニューで接続動詞をクリックする必要があります。その後、接続 UI が表示されます。

Web パーツ ゾーン コントロールとして、 ConnectionsZone コントロールは他のコントロールを格納するように設計されたゾーンの WebZone 種類 (クラスから CompositeControl 継承) です。 一般に ConnectionsZone 、ゾーンには、ヘッダー、本文またはコンテンツ領域、フッターなど、他の Web パーツ ツール ゾーンとほとんど同じ要素があります。 Web パーツ ゾーンとは何か、およびゾーンのさまざまな部分の詳細については、クラスの概要に関するページを WebZone 参照してください。

重要

他のほとんどの Web パーツ ゾーンとは異なり、ゾーンに関連付けられている一意の種類のサーバー コントロールが含まれていないことに ConnectionsZone 注意することが重要です。 ゾーンの一覧と、ゾーンに含まれる関連コントロールについては、クラスの概要のグラフを WebZone 参照してください。 ただし、ゾーンには ConnectionsZone コントロールが含 WebPartConnection まれていません。 代わりに、ユーザーがページ上の一部 WebPartZoneBase のゾーンに存在するサーバー コントロールを接続または切断するための UI を提供するという非常に限られた目的を果たします。 コントロールに ConnectionsZone 含まれるコントロールは、接続を形成するための UI の一部として生成される標準の ASP.NET サーバー コントロールだけです。

コントロールが ConnectionsZone レンダリングされると、接続を形成できるページ上のサーバー コントロールに基づいて UI が生成されます。 コントロールは ConnectionsZone 、ページ上のゾーン内の WebPartZoneBase サーバー コントロールがプロバイダー、コンシューマー、使用可能な接続ポイント、およびサーバー コントロールが現在接続されているか切断されているかを決定し、それに応じて UI を生成します。

たとえば、プロバイダーに対応するコントロールが 1 つ WebPart あり、1 つの WebPart コントロールがコンシューマーであり、ページ上の で WebPartZone 宣言され、現在切断されているとします。 ユーザーがページを接続モードに切り替え、いずれかのコントロールで接続動詞をクリックすると、 ConnectionsZone コントロールはリンクを含む UI を生成し、クリックすると、ユーザーが接続を作成するオプションを選択できるフォームを表示します。 (コントロールが以前に接続されていた場合、最初のビューには、コントロールを切断するためのボタンがユーザーに表示されます)。 新しい接続を作成するための接続 UI に、プロバイダーであるコントロールとコンシューマーであるコントロールが表示されます。 ドロップダウン リスト コントロールが各サーバー コントロールの下に表示され、コントロールに使用可能な ConnectionPoint オブジェクトが一覧表示されます。 それぞれのドロップダウン リストから、ユーザーはプロバイダーに接続する 1 つの ProviderConnectionPoint オブジェクト (コンシューマーと共有されるインターフェイスとデータを決定する) と、コンシューマーごとに 1 つの ConsumerConnectionPoint オブジェクト (コンシューマーが使用するインターフェイスとデータを決定する) を選択する必要があります。

注意

Web パーツ コントロール セットの既定の実装では、1 つのプロバイダーが多くのコンシューマーに接続できますが、コンシューマーはプロバイダーを 1 つだけ持つことができます。

コントロールを使用するには、 要素をConnectionsZone使用して<asp:connectionszone>、Web ページ上の<form>要素内で宣言するか (ただし、別の Web パーツ ゾーン要素内に入れ子にすることはできません)、またはプログラムによってページに追加できます。 ページ内の要素を宣言する場合、他の Web パーツ ゾーンとは異なり、要素のタグ間で他の種類のサーバー コントロールを <asp:connectionszone> 宣言することはできません。 その中で、独自のプロパティとスタイルの詳細に関連する要素を宣言できますが、これはスタンドアロン要素であり、他のサーバー コントロールを宣言できるテンプレート コントロールではありません。

注意

アクセシビリティを向上させるために、 ConnectionsZone コントロールは 要素内に <fieldset> レンダリングされます。 要素は <fieldset> 、コントロール内 ConnectionsZone の接続を確立するために使用される関連するコントロールのセットをグループ化し、ビジュアル ユーザー エージェント (通常の Web ブラウザーなど) と音声指向ユーザー エージェント (画面読み取りソフトウェアなど) の両方のコントロール間のタブナビゲーションを容易にします。

ConnectionsZoneコントロールには、接続 UI のレンダリングに使用するプロパティが多数あります。 プロパティの 1 つのセットには、接続に関連してのみ使用される複数の動詞が含まれています。これは、UI でアクションを実行します。 ConfigureVerbConnectVerbDisconnectVerb 接続ゾーン UI に特に使用される大きなプロパティ セットは、UI 内のさまざまな場所 (またはエラーが発生した場合など、特定の状況で) 表示されるテキスト文字列で構成されます。 ConfigureConnectionTitleConnectToConsumerInstructionTextConnectToConsumerTextConnectToConsumerTitleConnectToProviderInstructionTextConnectToProviderTextConnectToProviderTitleConsumersInstructionTextConsumersTitleExistingConnectionErrorMessageGetFromTextGetTextInstructionTitleNewConnectionErrorMessageNoExistingConnectionInstructionTextNoExistingConnectionTitleProvidersInstructionTextProvidersTitleSendTextSendToText ConnectionsZoneクラスには、他の Web パーツ ゾーンCancelVerbにある一般的なプロパティ (、 HeaderTextPartChromeTypeCloseVerbDisplayEmptyZoneTextInstructionTextなど) も含まれています。 最後に、 WebPartToConnect プロパティはクラスに固有であり、接続を開始するコントロールを参照します (これは、ユーザーが動詞メニューの connect 動詞をクリックするコントロールです。これは、コントロールの SelectedWebPart プロパティでWebPartManager参照されるコントロールでもあります)。

ConnectionsZoneまた、 クラスにはいくつかのメソッドがあり、そのすべてが基底クラスから継承およびオーバーライドされ、そのほとんどは基本 Web パーツ ゾーン クラスから取得されます。 詳細については、個々のメソッドを参照してください。

注意 (継承者)

開発者が ConnectionsZone 接続を操作するために提供する動作または既定の UI を変更する場合は、 クラスを拡張できます。

コンストラクター

ConnectionsZone()

ConnectionsZone クラスの新しいインスタンスを初期化します。

プロパティ

AccessKey

Web サーバー コントロールにすばやく移動できるアクセス キーを取得または設定します。

(継承元 WebControl)
Adapter

コントロール用のブラウザー固有のアダプターを取得します。

(継承元 Control)
AppRelativeTemplateSourceDirectory

このコントロールが含まれている Page オブジェクトまたは UserControl オブジェクトのアプリケーション相対の仮想ディレクトリを取得または設定します。

(継承元 Control)
AssociatedDisplayModes

特定の WebPartDisplayMode ゾーンに関連付けられた ToolZone オブジェクトのコレクションを取得します。

(継承元 ToolZone)
Attributes

コントロールのプロパティに対応しない任意の属性 (表示専用) のコレクションを取得します。

(継承元 WebControl)
BackColor

Web サーバー コントロールの背景色を取得または設定します。

(継承元 WebControl)
BackImageUrl

ゾーンの背景イメージの URL を取得または設定します。

(継承元 WebZone)
BindingContainer

このコントロールのデータ バインディングを格納しているコントロールを取得します。

(継承元 Control)
BorderColor

Web コントロールの境界線の色を取得または設定します。

(継承元 WebControl)
BorderStyle

Web サーバー コントロールの境界線スタイルを取得または設定します。

(継承元 WebControl)
BorderWidth

Web サーバー コントロールの境界線の幅を取得または設定します。

(継承元 WebControl)
CancelVerb

エンド ユーザーが接続確立のプロセスをキャンセルできるようにする WebPartVerb オブジェクトへの参照を取得します。

ChildControlsCreated

サーバー コントロールの子コントロールが作成されたかどうかを示す値を取得します。

(継承元 Control)
ClientID

ASP.NET によって生成される HTML マークアップのコントロール ID を取得します。

(継承元 Control)
ClientIDMode

ClientID プロパティの値を生成するために使用されるアルゴリズムを取得または設定します。

(継承元 Control)
ClientIDSeparator

ClientID プロパティで使用される区切り記号を表す文字値を取得します。

(継承元 Control)
CloseVerb

WebPartVerb コントロールによって作成された接続ユーザー インターフェイス (UI) をエンド ユーザーが閉じられるようにする ConnectionsZone オブジェクトへの参照を取得します。

ConfigureConnectionTitle

ConnectionsZone コントロールによって作成された接続ユーザー インターフェイス (UI) のサブセクションのタイトルとして表示されるテキストを取得または設定します。

ConfigureVerb

接続ユーザー インターフェイス (UI) の構成ビューを開くために使用する WebPartVerb オブジェクトへの参照を取得します。

ConnectToConsumerInstructionText

プロバイダーの接続先となるコンシューマー接続ポイントをユーザーが選択する、接続ユーザー インターフェイス (UI) のセクションに表示される指示テキストを取得または設定します。

ConnectToConsumerText

ユーザーが接続のコンシューマー コントロールを選択するビューを開くためにクリックするハイパーリンクのテキストを取得または設定します。

ConnectToConsumerTitle

ユーザーが接続する特定のコンシューマーを選択する、接続ユーザー インターフェイス (UI) のセクションのタイトル テキストを取得または設定します。

ConnectToProviderInstructionText

コンシューマーの接続先となるプロバイダー コネクション ポイントをユーザーが選択する、接続ユーザー インターフェイス (UI) のセクションに表示される指示テキストを取得または設定します。

ConnectToProviderText

ユーザーが接続のプロバイダー コントロールを選択するビューを開くためにクリックするハイパーリンクのテキストを取得または設定します。

ConnectToProviderTitle

ユーザーが接続する特定のプロバイダーを選択する、接続ユーザー インターフェイス (UI) のセクションのタイトル テキストを取得または設定します。

ConnectVerb

2 つの WebPartVerb コントロールが接続を確立できるようにする WebPart オブジェクトへの参照を取得します。

ConsumersInstructionText

接続が既に存在する場合に、接続ユーザー インターフェイス (UI) のコンシューマー セクションに表示される指示テキストを取得または設定します。

ConsumersTitle

接続が既に存在する場合に、接続ユーザー インターフェイス (UI) のコンシューマー セクションの上に表示されるタイトルを取得または設定します。

Context

現在の Web 要求に対するサーバー コントロールに関連付けられている HttpContext オブジェクトを取得します。

(継承元 Control)
Controls

ControlCollection 内の子コントロールを表す CompositeControl オブジェクトを取得します。

(継承元 CompositeControl)
ControlStyle

Web サーバー コントロールのスタイルを取得します。 このプロパティは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
ControlStyleCreated

Style オブジェクトが ControlStyle プロパティに対して作成されたかどうかを示す値を取得します。 このプロパティは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
CssClass

クライアントで Web サーバー コントロールによって表示されるカスケード スタイル シート (CSS: Cascading Style Sheet) クラスを取得または設定します。

(継承元 WebControl)
DataItemContainer

名前付けコンテナーが IDataItemContainer を実装している場合、名前付けコンテナーへの参照を取得します。

(継承元 Control)
DataKeysContainer

名前付けコンテナーが IDataKeysControl を実装している場合、名前付けコンテナーへの参照を取得します。

(継承元 Control)
DesignMode

コントロールがデザイン サーフェイスで使用されているかどうかを示す値を取得します。

(継承元 Control)
DisconnectVerb

接続されている 2 つの WebPartVerb コントロールの接続をユーザーが解除できるようにする WebPart オブジェクトへの参照を取得します。

Display

ToolZone コントロールが現在表示されているかどうかを示す値を取得します。

EditUIStyle

ToolZone コントロールに格納された編集可能なコントロールのスタイル属性を取得します。

(継承元 ToolZone)
EmptyZoneText

接続を確立するためのコントロールが Web ページ上で不十分な場合に、空の ConnectionsZone コントロールに表示されるテキスト メッセージを取得または設定します。

EmptyZoneTextStyle

空のゾーン内のプレースホルダー テキストのスタイル属性を取得または設定します。

(継承元 WebZone)
Enabled

Web サーバー コントロールを有効にするかどうかを示す値を取得または設定します。

(継承元 WebControl)
EnableTheming

テーマがこのコントロールに適用されるかどうかを示す値を取得または設定します。

(継承元 WebControl)
EnableViewState

要求元クライアントに対して、サーバー コントロールがそのビュー状態と、そこに含まれる任意の子のコントロールのビュー状態を保持するかどうかを示す値を取得または設定します。

(継承元 Control)
ErrorStyle

WebPart コントロールを読み込むことができない場合、または作成できない場合に表示されるエラー メッセージの表示のスタイル属性を取得します。

(継承元 WebZone)
Events

コントロールのイベント ハンドラー デリゲートのリストを取得します。 このプロパティは読み取り専用です。

(継承元 Control)
ExistingConnectionErrorMessage

既存の接続でエラーまたは警告が発生した場合に接続ユーザー インターフェイス (UI) に表示されるメッセージのテキストを取得または設定します。

Font

Web サーバー コントロールに関連付けられたフォント プロパティを取得します。

(継承元 WebControl)
FooterStyle

ゾーンのフッター領域の内容のスタイル属性を取得します。

(継承元 WebZone)
ForeColor

Web サーバー コントロールの前景色 (通常はテキストの色) を取得または設定します。

(継承元 WebControl)
GetFromText

コンシューマーのデータ取得元となる名前付きプロバイダーの前の、接続ユーザー インターフェイス (UI) のセクションに表示されるテキストを取得または設定します。

GetText

プロバイダーからのデータを受け取る名前付きコンシューマーの前の、接続ユーザー インターフェイス (UI) のセクションに表示されるテキストを取得または設定します。

HasAttributes

コントロールに属性セットがあるかどうかを示す値を取得します。

(継承元 WebControl)
HasChildViewState

現在のサーバー コントロールの子コントロールが、保存されたビューステートの設定を持っているかどうかを示す値を取得します。

(継承元 Control)
HasFooter

ゾーンにフッター領域があるかどうかを示す値を取得します。

(継承元 WebZone)
HasHeader

ゾーンにヘッダー領域があるかどうかを示す値を取得します。

(継承元 WebZone)
HeaderCloseVerb

コントロールを閉じるために使用される WebPartVerb コントロールのヘッダー内の ToolZone オブジェクトへの参照を取得します。

(継承元 ToolZone)
HeaderStyle

ゾーンのヘッダー領域の内容のスタイル属性を取得します。

(継承元 WebZone)
HeaderText

ConnectionsZone コントロールによって作成される接続ユーザー インターフェイス (UI) の一番上に表示されるヘッダー テキストを取得または設定します。

HeaderVerbStyle

ToolZone コントロールに表示されるすべてのヘッダー動詞のスタイル属性を取得します。

(継承元 ToolZone)
Height

Web サーバー コントロールの高さを取得または設定します。

(継承元 WebControl)
ID

サーバー コントロールに割り当てられたプログラム ID を取得または設定します。

(継承元 Control)
IdSeparator

コントロール ID を区別するために使用する文字を取得します。

(継承元 Control)
InstructionText

既存の接続を管理する接続ユーザー インターフェイス (UI) のセクションで、選択したコントロールに関する一般的な指示のために使用されるテキストを取得または設定します。

InstructionTextStyle

ToolZone コントロールの上部に表示される手順のテキストのスタイル属性を取得します。

(継承元 ToolZone)
InstructionTitle

既存の接続を管理する接続ユーザー インターフェイス (UI) 内で、コンシューマー コントロールまたはプロバイダー コントロールに対して実行できるアクションの一般的な説明に使用されるテキストを取得または設定します。

IsChildControlStateCleared

このコントロールに含まれているコントロールに、コントロールの状態が設定されているかどうかを示す値を取得します。

(継承元 Control)
IsEnabled

コントロールが有効かどうかを示す値を取得します。

(継承元 WebControl)
IsTrackingViewState

サーバー コントロールがビューステートの変更を保存しているかどうかを示す値を取得します。

(継承元 Control)
IsViewStateEnabled

このコントロールでビューステートが有効かどうかを示す値を取得します。

(継承元 Control)
LabelStyle

ToolZone コントロール内の編集コントロールと共に表示されるラベルの内容のスタイル属性を取得します。 ToolZoneCatalogZone などの派生した EditorZone コントロールは、ラベルにスタイルを適用します。

(継承元 ToolZone)
LoadViewStateByID

コントロールがインデックスではなく ID によりビューステートの読み込みを行うかどうかを示す値を取得します。

(継承元 Control)
NamingContainer

同じ ID プロパティ値を持つ複数のサーバー コントロールを区別するための一意の名前空間を作成する、サーバー コントロールの名前付けコンテナーへの参照を取得します。

(継承元 Control)
NewConnectionErrorMessage

ユーザーが作成しようとしている新しい接続でエラーまたは警告が発生した場合に接続ユーザー インターフェイス (UI) に表示されるメッセージのテキストを取得または設定します。

NoExistingConnectionInstructionText

Web パーツ コントロールに既存の接続がない場合に、接続ユーザー インターフェイス (UI) の本体に表示される指示テキストを取得または設定します。

NoExistingConnectionTitle

Web パーツ コントロールに既存の接続がない場合に、接続ユーザー インターフェイス (UI) の本体に表示されるタイトル テキストを取得または設定します。

Padding

ゾーンで WebPart コントロールを含むテーブルのセル内のスペースに関する属性を取得または設定します。

(継承元 WebZone)
Page

サーバー コントロールを含んでいる Page インスタンスへの参照を取得します。

(継承元 Control)
Parent

ページ コントロールの階層構造における、サーバー コントロールの親コントロールへの参照を取得します。

(継承元 Control)
PartChromePadding

WebPart コントロールにおけるコンテンツと境界線との間隔を取得または設定します。

(継承元 WebZone)
PartChromeStyle

ゾーンによって格納される Web パーツ コントロールの境界線に適用されるスタイル特性を取得します。

(継承元 WebZone)
PartChromeType

ConnectionsZone コントロールに含まれるサーバー コントロールの周囲を囲む境界線の種類を取得または設定します。

PartStyle

ゾーンに含まれる境界線および各 Web パーツ コントロールの内容に適用されるスタイル特性を取得します。

(継承元 WebZone)
PartTitleStyle

ゾーンに含まれる各 Web パーツ コントロールのタイトル バーの内容のスタイル属性を取得します。

(継承元 WebZone)
ProvidersInstructionText

接続が既に存在する場合に、接続ユーザー インターフェイス (UI) のプロバイダー セクションに表示される指示テキストを取得または設定します。

ProvidersTitle

接続が既に存在する場合に、接続ユーザー インターフェイス (UI) のプロバイダー セクションの上に表示されるタイトルを取得または設定します。

RenderClientScript

Web パーツ ページ上にクライアント スクリプトを表示するかどうかを示す値を取得します。

(継承元 WebZone)
RenderingCompatibility

レンダリングされる HTML と互換性がある ASP.NET のバージョンを表す値を取得します。

(継承元 Control)
SendText

コンシューマーにデータを送信する名前付きプロバイダーの前の、接続ユーザー インターフェイス (UI) のセクションに表示されるテキストを取得または設定します。

SendToText

プロバイダーのデータ送信先となる名前付きコンシューマーの前の、接続ユーザー インターフェイス (UI) のセクションに表示されるテキストを取得または設定します。

Site

デザイン サーフェイスに現在のコントロールを表示するときに、このコントロールをホストするコンテナーに関する情報を取得します。

(継承元 Control)
SkinID

コントロールに適用するスキンを取得または設定します。

(継承元 WebControl)
Style

Web サーバー コントロールの外側のタグにスタイル属性として表示されるテキスト属性のコレクションを取得します。

(継承元 WebControl)
SupportsDisabledAttribute

コントロールの disabled プロパティが IsEnabled の場合、レンダリングされた HTML 要素の false 属性を "無効" に設定するかどうかを示す値を取得します。

(継承元 CompositeControl)
TabIndex

Web サーバー コントロールのタブ インデックスを取得または設定します。

(継承元 WebControl)
TagKey

この Web サーバー コントロールに対応する HtmlTextWriterTag 値を取得します。 このプロパティは、主にコントロールの開発者によって使用されます。

(継承元 WebZone)
TagName

コントロール タグの名前を取得します。 このプロパティは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
TemplateControl

このコントロールを格納しているテンプレートへの参照を取得または設定します。

(継承元 Control)
TemplateSourceDirectory

現在のサーバー コントロールを格納している Page または UserControl の仮想ディレクトリを取得します。

(継承元 Control)
ToolTip

マウス ポインターが Web サーバー コントロールの上を移動したときに表示されるテキストを取得または設定します。

(継承元 WebControl)
UniqueID

階層構造で修飾されたサーバー コントロールの一意の ID を取得します。

(継承元 Control)
ValidateRequestMode

ブラウザーからのクライアント入力の安全性をコントロールで調べるかどうかを示す値を取得または設定します。

(継承元 Control)
VerbButtonType

ゾーン内の動詞を表すために使用されるボタンの種類を取得または設定します。

(継承元 WebZone)
VerbStyle

ゾーン内の Web パーツ コントロールに関連付けられたユーザー インターフェイス (UI) 動詞のスタイル属性を取得します。

(継承元 WebZone)
ViewState

同一のページに対する複数の要求にわたって、サーバー コントロールのビューステートを保存し、復元できるようにする状態情報のディクショナリを取得します。

(継承元 Control)
ViewStateIgnoresCase

StateBag オブジェクトが大文字小文字を区別しないかどうかを示す値を取得します。

(継承元 Control)
ViewStateMode

このコントロールのビューステート モードを取得または設定します。

(継承元 Control)
Visible

サーバー コントロールをユーザー インターフェイス (UI) 要素としてページに表示するかどうかを示す値を取得または設定します。

(継承元 ToolZone)
WebPartManager

Web パーツ ページ上の WebPartManager コントロールのインスタンスに関連付けられた WebZone コントロールへの参照を取得します。

(継承元 WebZone)
WebPartToConnect

接続先として現在選択されている WebPart コントロールを取得します。

Width

Web サーバー コントロールの幅を取得または設定します。

(継承元 WebControl)

メソッド

AddAttributesToRender(HtmlTextWriter)

指定した HtmlTextWriterTag に表示する必要のある HTML 属性およびスタイルを追加します。 このメソッドは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
AddedControl(Control, Int32)

子コントロールが Control オブジェクトの Controls コレクションに追加された後に呼び出されます。

(継承元 Control)
AddParsedSubObject(Object)

XML または HTML のいずれかの要素が解析されたことをサーバー コントロールに通知し、サーバー コントロールの ControlCollection オブジェクトに要素を追加します。

(継承元 Control)
ApplyStyle(Style)

指定したスタイルの空白以外の要素を Web コントロールにコピーして、コントロールの既存のスタイル要素を上書きします。 このメソッドは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
ApplyStyleSheetSkin(Page)

ページのスタイル シートに定義されたスタイル プロパティをコントロールに適用します。

(継承元 Control)
BeginRenderTracing(TextWriter, Object)

レンダリング データのデザイン時のトレースを開始します。

(継承元 Control)
BuildProfileTree(String, Boolean)

ページのトレースが有効な場合、サーバー コントロールに関する情報を収集し、これを表示するために Trace プロパティに渡します。

(継承元 Control)
ClearCachedClientID()

キャッシュされた ClientID 値を null に設定します。

(継承元 Control)
ClearChildControlState()

サーバー コントロールのすべての子コントロールについて、コントロールの状態情報を削除します。

(継承元 Control)
ClearChildState()

サーバー コントロールのすべての子コントロールのビューステート情報およびコントロールの状態情報を削除します。

(継承元 Control)
ClearChildViewState()

サーバー コントロールのすべての子コントロールのビューステート情報を削除します。

(継承元 Control)
ClearEffectiveClientIDMode()

現在のコントロール インスタンスおよびすべての子コントロールの ClientIDMode プロパティを Inherit に設定します。

(継承元 Control)
Close()

ConnectionsZone コントロールによって作成された接続ユーザー インターフェイス (UI) を閉じます。

CopyBaseAttributes(WebControl)

指定した Web サーバー コントロールから、Style オブジェクトでカプセル化されていないプロパティをこのメソッドの呼び出し元の Web サーバー コントロールにコピーします。 このメソッドは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
CreateChildControls()

サーバーへのポスト バックまたは表示のための準備として、ConnectionsZone コントロールに格納されるすべての子コントロールを作成します。

CreateControlCollection()

サーバー コントロールの子コントロール (リテラルとサーバーの両方) を保持する新しい ControlCollection オブジェクトを作成します。

(継承元 Control)
CreateControlStyle()

WebControl クラスで、すべてのスタイル関連プロパティを実装するために内部的に使用されるスタイル オブジェクトを作成します。 このメソッドは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
DataBind()

CompositeControl およびそのすべての子コントロールにデータ ソースをバインドします。

(継承元 CompositeControl)
DataBind(Boolean)

DataBinding イベントを発生させるオプションを指定して、呼び出されたサーバー コントロールとそのすべての子コントロールにデータ ソースをバインドします。

(継承元 Control)
DataBindChildren()

データ ソースをサーバー コントロールの子コントロールにバインドします。

(継承元 Control)
Dispose()

サーバー コントロールが、メモリから解放される前に最終的なクリーンアップを実行できるようにします。

(継承元 Control)
EndRenderTracing(TextWriter, Object)

レンダリング データのデザイン時のトレースを終了します。

(継承元 Control)
EnsureChildControls()

サーバー コントロールに子コントロールが含まれているかどうかを確認します。 含まれていない場合、子コントロールを作成します。

(継承元 Control)
EnsureID()

ID が割り当てられていないコントロールの ID を作成します。

(継承元 Control)
Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
FindControl(String)

指定した id パラメーターを使用して、サーバー コントロールの現在の名前付けコンテナーを検索します。

(継承元 Control)
FindControl(String, Int32)

指定した id および検索に役立つ pathOffset パラメーターに指定された整数を使用して、サーバー コントロールの現在の名前付けコンテナーを検索します。 この形式の FindControl メソッドはオーバーライドしないでください。

(継承元 Control)
Focus()

コントロールに入力フォーカスを設定します。

(継承元 Control)
GetDesignModeState()

コントロールのデザイン時データを取得します。

(継承元 Control)
GetEffectiveChromeType(Part)

ゾーンの PartChromeType プロパティおよび Web パーツ ページの現在の表示モードが指定されると、WebPart コントロールの実際のまたは現在有効な PartChromeType の値を返します。

(継承元 WebZone)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetRouteUrl(Object)

ルート パラメーターのセットに対応する URL を取得します。

(継承元 Control)
GetRouteUrl(RouteValueDictionary)

ルート パラメーターのセットに対応する URL を取得します。

(継承元 Control)
GetRouteUrl(String, Object)

ルート パラメーターのセットおよびルート名に対応する URL を取得します。

(継承元 Control)
GetRouteUrl(String, RouteValueDictionary)

ルート パラメーターのセットおよびルート名に対応する URL を取得します。

(継承元 Control)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
GetUniqueIDRelativeTo(Control)

指定されたコントロールの UniqueID プロパティのプレフィックス部分を返します。

(継承元 Control)
HasControls()

サーバー コントロールに子コントロールが含まれているかどうかを確認します。

(継承元 Control)
HasEvents()

コントロールまたは子コントロールに対してイベントが登録されているかどうかを示す値を返します。

(継承元 Control)
IsLiteralContent()

サーバー コントロールがリテラルな内容だけを保持しているかどうかを決定します。

(継承元 Control)
LoadControlState(Object)

SaveControlState() メソッドによって保存された前回のページ要求からコントロールの状態情報を復元します。

LoadViewState(Object)

SaveViewState() メソッドによって保存された前回のページ要求からビューステート情報を復元します。

MapPathSecure(String)

仮想パス (絶対パスまたは相対パス) の割り当て先の物理パスを取得します。

(継承元 Control)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
MergeStyle(Style)

指定したスタイルの空白以外の要素を Web コントロールにコピーしますが、コントロールの既存のスタイル要素は上書きしません。 このメソッドは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
OnBubbleEvent(Object, EventArgs)

サーバー コントロールのイベントをページの UI サーバー コントロールの階層構造に渡すかどうかを決定します。

(継承元 Control)
OnDataBinding(EventArgs)

DataBinding イベントを発生させます。

(継承元 Control)
OnDisplayModeChanged(Object, WebPartDisplayModeEventArgs)

DisplayModeChanged イベントを発生させます。

OnInit(EventArgs)

Init イベントを発生させます。

OnLoad(EventArgs)

Load イベントを発生させます。

(継承元 Control)
OnPreRender(EventArgs)

PreRender イベントを発生させます。

(継承元 WebZone)
OnSelectedWebPartChanged(Object, WebPartEventArgs)

SelectedWebPartChanged イベントを発生させます。

OnUnload(EventArgs)

Unload イベントを発生させます。

(継承元 Control)
OpenFile(String)

ファイルの読み込みで使用される Stream を取得します。

(継承元 Control)
RaiseBubbleEvent(Object, EventArgs)

イベントのソースおよびその情報をコントロールの親に割り当てます。

(継承元 Control)
RaisePostBackEvent(String)

ConnectionsZone コントロールを含んでいるフォームがサーバーにポスト バックされるときに、このコントロールのイベントを発生させます。

RecreateChildControls()

CompositeControl から派生したコントロール内に子コントロールを再作成します。

(継承元 CompositeControl)
RemovedControl(Control)

Control オブジェクトの Controls コレクションから子コントロールが削除された後に呼び出されます。

(継承元 Control)
Render(HtmlTextWriter)

指定した ConnectionsZone オブジェクトに、HtmlTextWriter コントロールの内容をレンダリングします。

RenderBeginTag(HtmlTextWriter)

指定した HtmlTextWriter オブジェクトにゾーン コントロールの HTML の開始タグを出力します。

(継承元 WebZone)
RenderBody(HtmlTextWriter)

ConnectionsZone コントロールの本体領域の内容を、指定した HtmlTextWriter オブジェクトに送信します。このオブジェクトは、その内容を Web ページに書き込みます。

RenderChildren(HtmlTextWriter)

提供された HtmlTextWriter オブジェクトに対してサーバー コントロールの子のコンテンツを出力すると、クライアントで表示されるコンテンツが記述されます。

(継承元 Control)
RenderContents(HtmlTextWriter)

開始タグと終了タグの間のゾーン コントロールのすべての内容を、指定した HtmlTextWriter オブジェクトに出力します。

(継承元 WebZone)
RenderControl(HtmlTextWriter)

指定の HtmlTextWriter オブジェクトにサーバー コントロールの内容を出力し、トレースが有効である場合はコントロールに関するトレース情報を保存します。

(継承元 Control)
RenderControl(HtmlTextWriter, ControlAdapter)

指定した ControlAdapter オブジェクトを使用して、指定した HtmlTextWriter オブジェクトにサーバー コントロールの内容を出力します。

(継承元 Control)
RenderEndTag(HtmlTextWriter)

コントロールの HTML 終了タグを指定したライターに表示します。 このメソッドは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
RenderFooter(HtmlTextWriter)

基本メソッドをオーバーライドして ToolZone コントロールのフッター内の動詞を表示します。

(継承元 ToolZone)
RenderHeader(HtmlTextWriter)

基本メソッドをオーバーライドして、ToolZone コントロールが必要とするヘッダー領域に専用の表示を提供します。

(継承元 ToolZone)
RenderVerb(HtmlTextWriter, WebPartVerb)

ToolZone コントロールで個別の動詞を表示します。

(継承元 ToolZone)
RenderVerbs(HtmlTextWriter)

ConnectionsZone コントロールのゾーン レベルの動詞を表示します。

ResolveAdapter()

指定したコントロールを表示するコントロール アダプターを取得します。

(継承元 Control)
ResolveClientUrl(String)

ブラウザーで使用できる URL を取得します。

(継承元 Control)
ResolveUrl(String)

要求側クライアントで使用できる URL に変換します。

(継承元 Control)
SaveControlState()

前回ページがサーバーにポスト バックされた後で発生した Web パーツ コントロールの状態の変更を保存します。

SaveViewState()

前回ページがサーバーにポストバックされた後で発生した ConnectionsZone コントロールのビューステートの変更を保存します。

SetDesignModeState(IDictionary)

コントロールのデザイン時データを設定します。

(継承元 Control)
SetRenderMethodDelegate(RenderMethod)

サーバー コントロールとその内容を親コントロールに表示するイベント ハンドラー デリゲートを割り当てます。

(継承元 Control)
SetTraceData(Object, Object)

トレース データ キーとトレース データ値を使用して、レンダリング データのデザイン時トレースのトレース データを設定します。

(継承元 Control)
SetTraceData(Object, Object, Object)

トレースされたオブジェクト、トレース データ キー、およびトレース データ値を使用して、レンダリング データのデザイン時トレースのトレース データを設定します。

(継承元 Control)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)
TrackViewState()

ConnectionsZone コントロールのビューステートへの変更を追跡し、変更をコントロールの StateBag オブジェクトに格納できるようにします。

イベント

DataBinding

サーバー コントロールがデータ ソースに連結すると発生します。

(継承元 Control)
Disposed

サーバー コントロールがメモリから解放されると発生します。これは、ASP.NET ページが要求されている場合のサーバー コントロールの有効期間における最終段階です。

(継承元 Control)
Init

サーバー コントロールが初期化されると発生します。これは、サーバー コントロールの有効期間における最初の手順です。

(継承元 Control)
Load

サーバー コントロールが Page オブジェクトに読み込まれると発生します。

(継承元 Control)
PreRender

Control オブジェクトの読み込み後、表示を開始する前に発生します。

(継承元 Control)
Unload

サーバー コントロールがメモリからアンロードされると発生します。

(継承元 Control)

明示的なインターフェイスの実装

IAttributeAccessor.GetAttribute(String)

指定された名前の Web コントロールの属性を取得します。

(継承元 WebControl)
IAttributeAccessor.SetAttribute(String, String)

Web コントロールの属性を指定された名前と値に設定します。

(継承元 WebControl)
ICompositeControlDesignerAccessor.RecreateChildControls()

デザイナーが、デザイン時環境で子コントロールの複合コントロールのコレクションを再作成できるようにします。

(継承元 CompositeControl)
IControlBuilderAccessor.ControlBuilder

このメンバーの詳細については、「ControlBuilder」をご覧ください。

(継承元 Control)
IControlDesignerAccessor.GetDesignModeState()

このメンバーの詳細については、「GetDesignModeState()」をご覧ください。

(継承元 Control)
IControlDesignerAccessor.SetDesignModeState(IDictionary)

このメンバーの詳細については、「SetDesignModeState(IDictionary)」をご覧ください。

(継承元 Control)
IControlDesignerAccessor.SetOwnerControl(Control)

このメンバーの詳細については、「SetOwnerControl(Control)」をご覧ください。

(継承元 Control)
IControlDesignerAccessor.UserData

このメンバーの詳細については、「UserData」をご覧ください。

(継承元 Control)
IDataBindingsAccessor.DataBindings

このメンバーの詳細については、「DataBindings」をご覧ください。

(継承元 Control)
IDataBindingsAccessor.HasDataBindings

このメンバーの詳細については、「HasDataBindings」をご覧ください。

(継承元 Control)
IExpressionsAccessor.Expressions

このメンバーの詳細については、「Expressions」をご覧ください。

(継承元 Control)
IExpressionsAccessor.HasExpressions

このメンバーの詳細については、「HasExpressions」をご覧ください。

(継承元 Control)
IParserAccessor.AddParsedSubObject(Object)

このメンバーの詳細については、「AddParsedSubObject(Object)」をご覧ください。

(継承元 Control)
IPostBackEventHandler.RaisePostBackEvent(String)

RaisePostBackEvent(String) メソッドを実装します。

(継承元 ToolZone)

拡張メソッド

FindDataSourceControl(Control)

指定されたコントロールのデータ コントロールに関連付けられているデータ ソースを返します。

FindFieldTemplate(Control, String)

指定されたコントロールの名前付けコンテナー内にある、指定された列のフィールド テンプレートを返します。

FindMetaTable(Control)

格納しているデータ コントロールのメタテーブル オブジェクトを返します。

GetDefaultValues(INamingContainer)

指定されたデータ コントロールの既定値のコレクションを取得します。

GetMetaTable(INamingContainer)

指定されたデータ コントロールのテーブル メタデータを取得します。

SetMetaTable(INamingContainer, MetaTable)

指定されたデータ コントロールのテーブル メタデータを設定します。

SetMetaTable(INamingContainer, MetaTable, IDictionary<String,Object>)

指定したデータ コントロールのテーブル メタデータおよび既定値のマッピングを設定します。

SetMetaTable(INamingContainer, MetaTable, Object)

指定したデータ コントロールのテーブル メタデータおよび既定値のマッピングを設定します。

TryGetMetaTable(INamingContainer, MetaTable)

テーブル メタデータが使用できるかどうかを判断します。

EnableDynamicData(INamingContainer, Type)

指定されたデータ コントロールの動的データの動作を有効にします。

EnableDynamicData(INamingContainer, Type, IDictionary<String,Object>)

指定されたデータ コントロールの動的データの動作を有効にします。

EnableDynamicData(INamingContainer, Type, Object)

指定されたデータ コントロールの動的データの動作を有効にします。

適用対象

こちらもご覧ください