CatalogZoneBase.EmptyZoneText Właściwość

Definicja

Pobiera lub ustawia komunikat wyświetlany, gdy strefa nie zawiera żadnych kontrolek.

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

Wartość właściwości

String

Ciąg zawierający komunikat wyświetlany w pustej strefie. Domyślny ciąg specyficzny dla kultury jest dostarczany przez .NET Framework.

Przykłady

W poniższym przykładzie kodu pokazano, jak deklaratywnie używać EmptyZoneText właściwości. Pełny kod wymagany do uruchomienia przykładu można znaleźć w sekcji Przykład w przeglądzie CatalogZoneBase klasy.

Zwróć uwagę, że przykładowy kod deklaruje dwa <asp:catalogzone> elementy, a drugi nie deklaruje żadnych CatalogPart kontrolek, choć przypisuje wartość do EmptyZoneText właściwości .

<asp:CatalogZone ID="CatalogZone1" runat="server"
  EmptyZoneText="No controls are in the zone."
  HeaderText="My Web Parts Catalog"
  InstructionText="Add Web Parts controls to the zone."
  PartLinkStyle-Font-Italic="true"
  SelectedPartLinkStyle-Font-Bold="true"
  SelectTargetZoneText="Select zone"
  AddVerb-Text="Add Control"
  CloseVerb-Description="Close and return to browse mode." 
  SelectedCatalogPartID="Currently Selected CatalogPart ID.">
  <ZoneTemplate>
    <asp:DeclarativeCatalogPart ID="DeclarativeCatalogPart1" 
      runat="server">
      <WebPartsTemplate>
        <aspSample:TextDisplayWebPart 
          runat="server"   
          id="textwebpart" 
          title = "Text Content WebPart" 
          ExportMode="All"/>  
        <asp:Calendar id="calendar1" runat="server" 
          Title="My Calendar" />               
      </WebPartsTemplate>
    </asp:DeclarativeCatalogPart> 
    <asp:PageCatalogPart ID="PageCatalogPart1" runat="server" />
    <asp:ImportCatalogPart ID="ImportCatalogPart1" runat="server" /> 
  </ZoneTemplate>
</asp:CatalogZone>
<hr />
<asp:CatalogZone ID="CatalogZone2" runat="server"
  BorderWidth="2"
  HeaderText="My Empty CatalogZone"
  EmptyZoneText="No controls are in the zone." />
<asp:CatalogZone ID="CatalogZone1" runat="server"
  EmptyZoneText="No controls are in the zone."
  HeaderText="My Web Parts Catalog"
  InstructionText="Add Web Parts controls to the zone."
  PartLinkStyle-Font-Italic="true"
  SelectedPartLinkStyle-Font-Bold="true"
  SelectTargetZoneText="Select zone"
  AddVerb-Text="Add Control"
  CloseVerb-Description="Close and return to browse mode." 
  SelectedCatalogPartID="Currently Selected CatalogPart ID.">
  <ZoneTemplate>
    <asp:DeclarativeCatalogPart ID="DeclarativeCatalogPart1" 
      runat="server">
      <WebPartsTemplate>
        <aspSample:TextDisplayWebPart 
          runat="server"   
          id="textwebpart" 
          title = "Text Content WebPart" 
          ExportMode="All"/>  
        <asp:Calendar id="calendar1" runat="server" 
          Title="My Calendar" />               
      </WebPartsTemplate>
    </asp:DeclarativeCatalogPart> 
    <asp:PageCatalogPart ID="PageCatalogPart1" runat="server" />
    <asp:ImportCatalogPart ID="ImportCatalogPart1" runat="server" /> 
  </ZoneTemplate>
</asp:CatalogZone>
<hr />
<asp:CatalogZone ID="CatalogZone2" runat="server"
  BorderWidth="2"
  HeaderText="My Empty CatalogZone"
  EmptyZoneText="No controls are in the zone." />

Po załadowaniu strony w przeglądarce możesz wybrać pozycję Wykaz z listy rozwijanej, aby przełączyć się do trybu wyświetlania wykazu. Gdy wykaz jest widoczny, zwróć uwagę, że poniżej pierwszej strefy, która zawiera dwie CatalogPart kontrolki, zostanie wyświetlona druga strefa i wyświetli zawartość EmptyZoneText właściwości, ponieważ nie zawiera żadnych kontrolek.

Uwagi

Wartość EmptyZoneText ciągu właściwości jest wyświetlana, gdy strona sieci Web wchodzi w tryb wykazu, jeśli CatalogZoneBase strefa nie CatalogPart zawiera żadnych kontrolek.

Dotyczy

Zobacz też