Share via


ConnectionsZone.ConfigureVerb Proprietà

Definizione

Ottiene un riferimento a un oggetto WebPartVerb utilizzato per aprire la visualizzazione configurazione nell'interfaccia utente di connessione.

public:
 virtual property System::Web::UI::WebControls::WebParts::WebPartVerb ^ ConfigureVerb { System::Web::UI::WebControls::WebParts::WebPartVerb ^ get(); };
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public virtual System.Web.UI.WebControls.WebParts.WebPartVerb ConfigureVerb { get; }
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
member this.ConfigureVerb : System.Web.UI.WebControls.WebParts.WebPartVerb
Public Overridable ReadOnly Property ConfigureVerb As WebPartVerb

Valore della proprietà

Oggetto WebPartVerb utilizzata per aprire la sezione Configura connessioni nell'interfaccia utente di connessione.

Attributi

Esempio

Nell'esempio di codice seguente viene illustrato l'uso della ConfigureVerb proprietà con un ConnectionsZone controllo . L'esempio contiene solo il codice per la pagina Web che illustra l'uso della proprietà ; per gli altri due file di codice necessari per eseguire l'esempio, vedere la sezione Esempio della panoramica della ConnectionsZone classe. L'esempio di codice ha quattro parti:

  • Controllo utente che consente di cambiare modalità di visualizzazione nella pagina Web. Ottenere questo codice dalla panoramica della ConnectionsZone classe.

  • Un file di origine che contiene il codice per un'interfaccia zip code e due WebPart controlli che fungono da provider e consumer per una connessione. Ottenere questo codice dalla panoramica della ConnectionsZone classe.

  • Una pagina Web che ospita tutti i controlli, dichiara un <asp:connectionszone> elemento e mostra come usare la proprietà in modo dichiarativo e programmatico.

  • Spiegazione del funzionamento dell'esempio in un browser.

La pagina Web dichiara un <asp:connectionszone> elemento e all'interno dell'elemento dichiara un <configureverb> elemento e imposta una proprietà usando gli attributi. Inoltre, nel Page_PreRender metodo , il codice imposta una proprietà sul verbo di configurazione per il ConnectionsZone controllo .

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

Caricare la pagina in un browser. Passare alla modalità di connessione usando il controllo Modalità di visualizzazione . Fare clic sulla freccia del menu verbi nel controllo Provider di cap code e fare clic sul verbo di connessione. Si noti che è presente un pulsante Termina connessione per disconnettere i controlli già connessi e un pulsante Configura disabilitato. Se nell'esempio di codice è stato usato un trasformatore che include una configurazione guidata, il pulsante Configura verrà abilitato e gli utenti potrebbero fare clic su di esso per configurare la connessione. Se si posiziona il puntatore del mouse sul pulsante Configura nell'interfaccia utente di connessione, il testo della descrizione personalizzata viene visualizzato in una descrizione comando.

Commenti

Il verbo di configurazione viene visualizzato nella sezione Gestisci connessioni dell'interfaccia utente della connessione, quando esiste già una connessione e un utente ha aperto l'interfaccia utente della connessione. L'interfaccia utente presenta agli utenti un pulsante Termina connessione per terminare la connessione e un pulsante Configura (che rappresenta il verbo di configurazione) per configurare la connessione. Se un utente fa clic sul pulsante Configura , viene visualizzata la sezione Configura connessioni dell'interfaccia utente, consentendo agli utenti di configurare la connessione. Questa opzione per configurare una connessione (e quindi il pulsante Configura ) è abilitata solo quando la connessione usa un trasformatore e il trasformatore include un controllo configurazione guidata (Wizard) che consente di configurarlo dagli utenti. Per informazioni dettagliate, vedere la WebPartTransformer classe .

Usare la ConfigureVerb proprietà per ottenere un riferimento all'oggetto corrispondente WebPartVerb nell'interfaccia utente. Anche se la proprietà stessa è di sola lettura, dopo aver ottenuto un riferimento al verbo, è possibile modificarne i valori di proprietà in base alle esigenze.

È possibile impostare i valori delle proprietà del verbo configure in modo dichiarativo dichiarando l'elemento <configureverb> all'interno dei tag di un <asp:connectionszone> elemento. Le proprietà del verbo possono essere impostate in modo dichiarativo nel formato Property-Subproperty, dove Subproperty è una proprietà dell'oggetto WebPartVerb , ConfigureVerb-Textad esempio . È anche possibile impostare le proprietà a livello di codice nel modulo Property.Subproperty , ad esempio ConfigureVerb.Text.

Si applica a

Vedi anche