ConnectionsZone.ProvidersTitle Eigenschaft

Definition

Ruft den Titel ab, der oberhalb des Consumer-Abschnitts der Benutzeroberfläche für Verbindungen angezeigt wird, wenn bereits eine Verbindung besteht, oder legt diesen Titel fest.

public:
 virtual property System::String ^ ProvidersTitle { System::String ^ get(); void set(System::String ^ value); };
public virtual string ProvidersTitle { get; set; }
member this.ProvidersTitle : string with get, set
Public Overridable Property ProvidersTitle As String

Eigenschaftswert

Eine Zeichenfolge, die als Titeltext für Anbieter dient, die an einer Verbindung teilnehmen. Der Standardtitel ist eine von .NET Framework bereitgestellte kulturspezifische Zeichenfolge.

Beispiele

Im folgenden Codebeispiel wird die Verwendung der ProvidersTitle -Eigenschaft mit einem ConnectionsZone -Steuerelement veranschaulicht. Das Beispiel enthält nur den Code für die Webseite, der die Verwendung der Eigenschaft veranschaulicht. Informationen zu den beiden anderen Codedateien, die zum Ausführen des Beispiels erforderlich sind, finden Sie im Abschnitt Beispiel der ConnectionsZone Klassenübersicht. Das Codebeispiel umfasst vier Teile:

  • Ein Benutzersteuerelement, mit dem Sie die Anzeigemodi auf der Webseite wechseln können. Rufen Sie diesen Code aus der ConnectionsZone Klassenübersicht ab.

  • Eine Quelldatei, die den Code für eine POSTLEITZAHL-Schnittstelle und zwei WebPart Steuerelemente enthält, die als Anbieter und Consumer für eine Verbindung fungieren. Rufen Sie diesen Code aus der ConnectionsZone Klassenübersicht ab.

  • Eine Webseite, die alle Steuerelemente hostet, ein <asp:connectionszone> -Element deklariert und zeigt, wie die Eigenschaft programmgesteuert verwendet wird.

  • Eine Erklärung, wie das Beispiel in einem Browser funktioniert.

Die Webseite deklariert ein <asp:connectionszone> Element, und in der Page_PreRender -Methode weist der Code der ProvidersTitle -Eigenschaft einen Wert zu.

<%@ 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>

Laden Sie die Seite in einen Browser. Wechseln Sie mit dem Steuerelement Anzeigemodus in den Verbindungsmodus. Klicken Sie im Steuerelement Postleitzahl-Consumer auf den Menüpfeil im Verbenmenü, und klicken Sie dann auf das Verb verbinden. Suchen Sie in der Ansicht, die für die vorhandene Verbindung geöffnet wird, im Abschnitt anbieter nach dem benutzerdefinierten Text, der der ProvidersTitle Eigenschaft zugewiesen ist.

Hinweise

Die ProvidersTitle -Eigenschaft wird in einem bestimmten Verbindungsszenario wirksam. Wenn ein Benutzer in einem Consumersteuerelement auf das Verb Verbinden klickt und bereits eine Verbindung vorhanden ist, zeigt das Steuerelement eine Ansicht an, mit der ConnectionsZone Benutzer die Verbindung trennen können. Die Ansicht zeigt auch alle Anbieter an, die an der Verbindung teilnehmen. Direkt über der Liste der Anbieter befindet sich der Anbieter-Anweisungstext, und darüber der Titel des Abschnitts anbieter, für den die ProvidersTitle -Eigenschaft den Text bereitstellt.

Sie können den Wert dieser Eigenschaft deklarativ im öffnenden Tag des <asp:connectionszone> Elements festlegen, indem Sie ein Attribut namens ProvidersTitle hinzufügen und ihm einen Wert zuweisen. Sie können den Eigenschaftswert auch programmgesteuert festlegen.

Gilt für:

Weitere Informationen