ConnectionsZone.CloseVerb プロパティ
アセンブリ: System.Web (system.web.dll 内)
構文
エンド ユーザーが接続 UI を閉じられるようにする WebPartVerb。
ConnectionsZone コントロールで使用される場合の Close 動詞は、接続 UI の下部 (フッター) に表示されるゾーン レベルの動詞です。ユーザーが Close 動詞をクリックすると、接続プロセスがキャンセルされて接続 UI が閉じますが、ページは接続表示モードのままになります。この時点で、ユーザーはページをブラウズ モードに戻すか、または、もう一方のサーバー コントロールの Connect 動詞をクリックしてもう一度接続 UI を開くことができます。
Close 動詞は、ヘッダーの Close 動詞と区別する必要があります (詳細については、HeaderCloseVerb プロパティのトピックを参照してください)。いずれの動詞も接続 UI を閉じるという同じアクションを実行しますが、ヘッダーの Close 動詞が UI の一番上に表示され、既定ではハイパーリンクで表されるのに対し、Close 動詞は UI の一番下に表示され、既定ではボタンで表されます。
CloseVerb プロパティは、UI の対応する WebPartVerb オブジェクトへの参照を取得するために使用します。このプロパティ自体は読み取り専用ですが、動詞への参照を取得した後は、必要に応じてプロパティ値を変更できます。
Close 動詞のプロパティ値は、<asp:connectionszone> 要素のタグの中で <closeverb> 要素を宣言することにより、宣言で設定できます。この動詞のプロパティは、Property-Subproperty の形式で宣言によって設定できます。ここで、Subproperty は WebPartVerb オブジェクトのプロパティを表します (例 : CloseVerb-Text)。また、このプロパティは、Property.Subproperty の形式でプログラムによって設定することもできます (例 : CloseVerb.Text)。
ConnectionsZone コントロールで CloseVerb プロパティを使用するコード例を次に示します。この例には、Web ページの、このプロパティの使用方法を示すコードだけが含まれています。例を実行するために必要な他の 2 つのコード ファイルについては、ConnectionsZone クラスの概要の「使用例」を参照してください。コード例は、次の 4 つの部分から成ります。
-
Web ページ上の表示モードを切り替えられるようにするユーザー コントロール。このコードは、ConnectionsZone クラスの概要から取得してください。
-
ZIP Code インターフェイスのコード、および、接続のプロバイダとコンシューマとして機能する 2 つの WebPart コントロールのコードを含んでいるソース ファイル。このコードは、ConnectionsZone クラスの概要から取得してください。
-
すべてのコントロールをホストし、<asp:connectionszone> 要素を宣言し、宣言およびプログラムによってプロパティを使用する方法を示す Web ページ。
この Web ページでは、<asp:connectionszone> 要素を宣言し、この要素内で <closeverb> 要素を宣言し、属性を使用して 1 つのプロパティを設定しています。また、Page_PreRender メソッドで ConnectionsZone コントロールの Close 動詞の 1 つのプロパティを設定しています。
<%@ 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 > <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>
<%@ 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 > <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>
ブラウザにページを読み込みます。[表示モード] コントロールを使用して、接続モードに切り替えます。[ZIP Code Provider] コントロールの動詞メニューの矢印をクリックし、Connect 動詞をクリックします。[End Connection] ボタンをクリックして、ページ上の宣言による接続で既に接続されているコントロールの接続を解除します。[Select a consumer for the provider to connect with] ハイパーリンクをクリックして、さまざまなプロパティの設定による効果を確認します。接続 UI の下部にある [Close Zone] ボタン上にマウス ポインタを置くと、ツールヒントにカスタムの説明テキストが表示されます。接続ゾーンの一番上にあるヘッダーの Close 動詞がハイパーリンクで表されており、Close 動詞へのプロパティの割り当てがヘッダーの Close 動詞に影響していないことを確認してください。
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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
Weblioに収録されているすべての辞書からConnectionsZone.CloseVerb プロパティを検索する場合は、下記のリンクをクリックしてください。
全ての辞書からConnectionsZone.CloseVerb プロパティを検索
- ConnectionsZone.CloseVerb プロパティのページへのリンク