Redigera

Dela via


DeclarativeCatalogPart.WebPartsTemplate Property

Definition

Gets or sets a reference to a template that contains the WebPart controls declared in a catalog.

public:
 property System::Web::UI::ITemplate ^ WebPartsTemplate { System::Web::UI::ITemplate ^ get(); void set(System::Web::UI::ITemplate ^ value); };
[System.ComponentModel.Browsable(false)]
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
[System.Web.UI.TemplateContainer(typeof(System.Web.UI.WebControls.WebParts.DeclarativeCatalogPart))]
public System.Web.UI.ITemplate WebPartsTemplate { get; set; }
[<System.ComponentModel.Browsable(false)>]
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
[<System.Web.UI.TemplateContainer(typeof(System.Web.UI.WebControls.WebParts.DeclarativeCatalogPart))>]
member this.WebPartsTemplate : System.Web.UI.ITemplate with get, set
Public Property WebPartsTemplate As ITemplate

Property Value

An ITemplate that contains controls declared in a catalog.

Attributes

Examples

The following code example demonstrates the declarative use of the WebPartsTemplate property. For the full code required to run the example, see the Example section of the DeclarativeCatalogPart class overview.

This code shows how to insert the <webpartstemplate> element within an <asp:declarativecatalogpart> element in declarative markup.

<asp:CatalogZone ID="CatalogZone1" runat="server">
  <ZoneTemplate>
    <asp:DeclarativeCatalogPart ID="DeclarativeCatalogPart1"  
      runat="server" 
      Title="Web Parts Catalog"
      ChromeType="TitleOnly" 
      Description="Contains a user control with Web Parts and 
        an ASP.NET Calendar control.">
      <WebPartsTemplate>
        <asp:Calendar ID="Calendar1" runat="server" 
          Title="My Calendar" 
          Description="ASP.NET Calendar control used as a personal calendar." />
        <aspSample:UserInfoWebPart 
          runat="server"   
          id="userinfo1" 
          title = "User Information WebPart"
          Description ="Contains custom, editable user information 
            for display on a page." />
        <aspSample:TextDisplayWebPart 
          runat="server"   
          id="TextDisplayWebPart1" 
          title = "Text Display WebPart" 
          Description="Contains a label that users can dynamically update." />
      </WebPartsTemplate>              
    </asp:DeclarativeCatalogPart>
  </ZoneTemplate>
</asp:CatalogZone>
<asp:CatalogZone ID="CatalogZone1" runat="server">
  <ZoneTemplate>
    <asp:DeclarativeCatalogPart ID="DeclarativeCatalogPart1"  
      runat="server" 
      Title="Web Parts Catalog"
      ChromeType="TitleOnly" 
      Description="Contains a user control with Web Parts and 
        an ASP.NET Calendar control.">
      <WebPartsTemplate>
        <asp:Calendar ID="Calendar1" runat="server" 
          Title="My Calendar" 
          Description="ASP.NET Calendar control used as a personal calendar." />
        <aspSample:UserInfoWebPart 
          runat="server"   
          id="userinfo1" 
          title = "User Information WebPart"
          Description ="Contains custom, editable user information 
            for display on a page." />
        <aspSample:TextDisplayWebPart 
          runat="server"   
          id="TextDisplayWebPart1" 
          title = "Text Display WebPart" 
          Description="Contains a label that users can dynamically update." />
      </WebPartsTemplate>              
    </asp:DeclarativeCatalogPart>
  </ZoneTemplate>
</asp:CatalogZone>

Remarks

The WebPartsTemplate property references the template that contains controls declared on a Web page as part of a catalog. In the hierarchy of declarative elements within a CatalogZone zone, the WebPartsTemplate property is represented by the <webpartstemplate> element, which is a child element of the <asp:declarativecatalogpart> element, and contains all explicitly declared server controls in a catalog.

Applies to

See also