- DeclarativeCatalogPart Web Server Control
in ASP.NET environment,This article describes you how to work with DeclarativeCatalogPart Web Control.The primary function of the DeclarativeCatalogPart control is to adding catalog of web parts to a web page.Likewise adding other server control to a web page with the declarative format.
Its a major advantage of the DeclarativeCatalogPart control that it does not require any coding when create a catalog of server controls. Page developers can work with the control entirely in the declarative (or page persistence) format, hence the name of the control.he DeclarativeCatalogPart control has a useful property that allows developers to set up a catalog of controls that can be used throughout an entire site
Tool-oriented controls of the Web parts control set have following 2 features:
- These controls are helper controls which allows the user to personlize controls in a page
- Those can be visible in certain modes
DeclarativeCatalogPart's Methods
- GetAvailableWebPartDescriptions - The method retrieves a WebPartDescription object for each WebPart control in the catalog, which enables a DeclarativeCatalogPart control to display information about each server control without having to create an instance of it
- GetWebPart -This method gets an instance of a particular WebPart control, based on the description passed to the method.
the following code snippets demonstrates how to work with the demonstrates Control
in .aspx page,
-
<%@ register TagPrefix="uc1"
TagName="DisplayModeMenuVB"
Src="DisplayModeMenuVB.ascx" %>
<%@ register tagprefix="aspSample"
Namespace="Samples.AspNet.VB.Controls"
Assembly="UserInfoWebPartVB" %>
<html>
<head id="Head1" runat="server">
<title>
DeclarativeCatalogPart Control
</title>
</head>
<body>
<form id="form2" runat="server">
<asp:webpartmanager id="wp1" runat="server" />
<uc1:DisplayModeMenuCS ID="DisplayModeMenu1" runat="server" />
<asp:webpartzone id="zone1" runat="server" >
<PartTitleStyle BorderWidth=1
Font-Names="Verdana, Arial"
Font-Size="110%"
BackColor="LightBlue" />
<zonetemplate>
<asp:BulletedList ID="BulletedList1"
Runat="server"
DisplayMode="HyperLink"
Title="Favorites">
<asp:ListItem Value="http://www.gmail.com">
Gmail
</asp:ListItem>
</asp:BulletedList>
</zonetemplate>
</asp:webpartzone>
<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:EditorZone ID="EditorZone1" runat="server">
<ZoneTemplate>
<asp:PropertyGridEditorPart ID="PropertyGridEditorPart1" runat="server" />
</ZoneTemplate>
</asp:EditorZone>
</form>
</body>
</html>
-
- Related Links
-
91f74dc5-4428-47f9-b57f-ad635cb05b7b|0|.0
634ec283-213b-4ad8-9b31-4a90c469334a|0|.0