ConnectionsZone.ConnectToConsumerInstructionText Propriedade
Definição
Obtém ou define o texto de instrução exibido na seção da IU (interface do usuário) de conexão em que os usuários selecionam um ponto de conexão do consumidor ao qual o provedor se conectará.Gets or sets the instructional text displayed in the section of the connection user interface (UI) where users select a consumer connection point that the provider will connect to.
public:
virtual property System::String ^ ConnectToConsumerInstructionText { System::String ^ get(); void set(System::String ^ value); };
public virtual string ConnectToConsumerInstructionText { get; set; }
member this.ConnectToConsumerInstructionText : string with get, set
Public Overridable Property ConnectToConsumerInstructionText As String
Valor da propriedade
Uma cadeia de caracteres que contém as instruções para criar uma conexão de consumidor com o provedor.A string containing the instructions for creating a consumer connection to the provider. O texto padrão é uma cadeia de caracteres específica de cultura fornecida pelo .NET Framework.The default text is a culture-specific string supplied by the .NET Framework.
Exemplos
O exemplo de código a seguir demonstra o uso da ConnectToConsumerInstructionText propriedade com um ConnectionsZone controle.The following code example demonstrates the use of the ConnectToConsumerInstructionText property with a ConnectionsZone control. O exemplo contém apenas o código para a página da Web que demonstra o uso da propriedade; para os outros dois arquivos de código necessários para executar o exemplo, consulte a seção de exemplo da ConnectionsZone classe visão geral.The example contains only the code for the Web page that demonstrates use of the property; for the other two code files needed to run the example, see the Example section of the ConnectionsZone class overview. O exemplo de código tem quatro partes:The code example has four parts:
Um controle de usuário que permite que você alterne modos de exibição na página da Web.A user control that enables you to switch display modes on the Web page. Obtenha esse código na ConnectionsZone visão geral da classe.Obtain this code from the ConnectionsZone class overview.
Um arquivo de origem que contém o código para uma interface de CEP e dois WebPart controles que atuam como o provedor e o consumidor para uma conexão.A source file that contains the code for a ZIP Code interface, and two WebPart controls acting as the provider and the consumer for a connection. Obtenha esse código na ConnectionsZone visão geral da classe.Obtain this code from the ConnectionsZone class overview.
Uma página da Web que hospeda todos os controles, declara um
<asp:connectionszone>elemento e mostra como usar a propriedade de forma programática.A Web page that hosts all the controls, declares an<asp:connectionszone>element, and shows how to use the property programmatically.Uma explicação de como o exemplo funciona em um navegador.An explanation of how the example works in a browser.
A página da Web declara um <asp:connectionszone> elemento e, no Page_PreRender método, o código atribui um valor à ConnectToConsumerInstructionText propriedade.The Web page declares an <asp:connectionszone> element and, in the Page_PreRender method, the code assigns a value to the ConnectToConsumerInstructionText property.
<%@ 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>
Carregue a página em um navegador.Load the page in a browser. Alterne para o modo de conexão usando o controle modo de exibição .Switch to connect mode, using the Display Mode control. Clique na seta de menu de verbos no controle do provedor de CEP e clique no verbo conectar.Click the verbs menu arrow on the ZIP Code Provider control, and click the connect verb. Clique no botão encerrar conexão para encerrar a conexão e, em seguida, clique em selecionar um consumidor para o provedor para se conectar com o hiperlink.Click the End Connection button to end the connection, and then click the Select a consumer for the provider to connect with hyperlink. A interface de usuário da conexão do consumidor é exibida e o texto personalizado atribuído à ConnectToConsumerInstructionText propriedade aparece logo acima da área com o controle que permite que você selecione um ponto de conexão no consumidor para se conectar com o provedor.The consumer connection UI appears, and the custom text assigned to the ConnectToConsumerInstructionText property appears just above the area with the control that allows you to select a connection point on the consumer for connecting with the provider.
Comentários
A ConnectToConsumerInstructionText Propriedade entra em vigor em um cenário de conexão específico.The ConnectToConsumerInstructionText property takes effect in a specific connection scenario. Quando um usuário clica no verbo Connect em um controle de provedor, o ConnectionsZone controle exibe uma parte da interface do usuário de conexão que permite que os usuários selecionem um consumidor.When a user clicks the connect verb on a provider control, the ConnectionsZone control displays a portion of the connection UI that enables users to select a consumer. Se o usuário clicou em um verbo Connect no consumidor, a interface do usuário de conexão faria o inverso e exibiria informações sobre como se conectar a um provedor.If the user clicked a connect verb on the consumer, then the connection UI would do the reverse, and display information about connecting to a provider.
O texto na ConnectToConsumerInstructionText propriedade é exibido logo acima dos controles de lista suspensa que contêm os pontos de conexão de consumidor disponíveis aos quais um provedor pode ser conectado.The text in the ConnectToConsumerInstructionText property is displayed just above the drop-down list controls that contain the available consumer connection points to which a provider can be connected.
Você pode definir essa propriedade declarativamente, usando o ConnectToConsumerInstructionText atributo na marca de abertura do <asp:connectionszone> elemento em uma página ou pode definir a propriedade programaticamente.You can set this property declaratively, by using the ConnectToConsumerInstructionText attribute in the opening tag of the <asp:connectionszone> element in a page, or you can set the property programmatically.