Onlineatoz.net | ToolBox WepParts Control ConnectionsZone

ToolBox WepParts Control ConnectionsZone

ConnectionsZone Web Server Control

in ASP.NET environment,This article describes you how to work with ConnectionsZone Web Control.The mechanism of ConnectionsZone can provide an editor control that enables users to form connections on web Part controls and server controls.

The following ways helps you to connect controls:

  • Initially,Declare a connection.
  • Creating a connection in code.
  • Adding a ConnectionsZone control to the page

You can using two server controls to form a connection and share data, with one control acting as the provider, and the other acting as the consumer of the data Using the Web Parts control set. Here, two controls may be Webpart control or server control.

Enabling a ConnectionsZone Control

When the web page in connect mode,then the ConnectionsZone control becomes visible. After users switch a page into connect mode, they must click a connect verb of one of the server controls to display the connection UI.

the following code snippets demonstrates how to work with the ConnectionsZone Control

in .aspx.cs page,

 protected void Page_PreRender(object sender, EventArgs e)
{
cz1.CancelVerb.Description =
"Terminates the connection process";
cz1.CloseVerb.Description =
"Closes the connections UI";
cz1.ConfigureVerb.Description =
"Configure the transformer for the connection";
cz1.ConnectVerb.Description =
"Connect two WebPart controls";
cz1.DisconnectVerb.Description =
"End the connection between two controls";

cz1.ConfigureConnectionTitle =
"Configure";
cz1.ConnectToConsumerInstructionText =
"Choose a consumer connection point";
cz1.ConnectToConsumerText =
"Select a consumer for the provider to connect with";
cz1.ConnectToConsumerTitle =
"Send data to this consumer";
cz1.ConnectToProviderInstructionText =
"Choose a provider connection point";
cz1.ConnectToProviderText =
"Select a provider for the consumer to connect with";
cz1.ConnectToProviderTitle =
"Get data from this provider";
cz1.ConsumersInstructionText =
"WebPart controls that receive data from providers";
cz1.ConsumersTitle = "Consumer Controls";
cz1.GetFromText = "Receive from";
cz1.GetText = "Retrieve";
cz1.HeaderText =
"Create and Manage Connections";
cz1.InstructionText =
"Manage connections for the selected WebPart control";
cz1.InstructionTitle =
"Manage connections for consumers or providers";
cz1.NoExistingConnectionInstructionText =
"No connections exist. Click the above link to create "
+ "a connection.";
cz1.NoExistingConnectionTitle =
"No current connections";
cz1.ProvidersInstructionText =
"WebPart controls that send data to consumers";
cz1.ProvidersTitle = "Provider controls";
}

in .aspx page,

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

<html >
<head id="Head1" runat="server">
<title>Sample</title>
</head>
<body>
<form id="form2" runat="server">
<asp:webpartmanager runat="server" id="mgr">
<staticconnections>
<asp:webpartconnection id="wpc1"
consumerconnectionpointid="ZipCodeConsumer"
consumerid="zipConsumer"
providerconnectionpointid="ZipCodeProvider"
providerid="zipProvider" />
</staticconnections>
</asp:webpartmanager>
<uc1:displaymodemenucs id="menu1" runat="server" />
<div>
<asp:webpartzone id="wpz1" 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="cz1" 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>
 
Related Links

Posted by: Admin
Posted on: 9/13/2011 at 6:59 AM
Categories: Asp.net
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed