- PageCatalogPart Web Server Control
in ASP.NET environment,This article describes you how to work with PageCatalogPart Web Control.The primary function of the DeclarativeCatalogPart control is that provides a catalog that holds references to all WebPart controls which a user has closed on a single Web Parts page.during a page is running, The user interface of the PageCatalogPart control enables the user to add the closed controls back to the page.
Here, This control only at visible stage when a page is in catalog display mode. when an user needs with closing and reopening controls, then Add a PageCatalogPart control to your page.
A Closed Control
A closed control has several attributes such as:
- It does not visible on the page.
- It does not rendered on the page.
- It does not participate in page life-cycle phases.
The following elements must need to include with a page
- <asp:catalogzone> element must be included, and a child <zonetemplate> element must be added to it
- <asp:PageCatalogPart> element must be added as a child of the <zonetemplate> element.
the following code snippets demonstrates how to work with the PageCatalogPart Control
in .aspx page,
-
<%@ register TagPrefix="uc1"
TagName="DisplayModeMenuCS"
Src="DisplayModeMenuCS.ascx" %>
<%@ register tagprefix="aspSample"
Namespace="Samples.AspNet.CS.Controls"
Assembly="UserInfoWebPartCS" %>
<html>
<head id="Head1" runat="server">
<title>
PageCatalogPart Example
</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:PageCatalogPart ID="PageCatalogPart1" runat="server"
Title="My Page Catalog"
ChromeType="Titleonly" />
<asp:DeclarativeCatalogPart ID="DeclarativeCatalogPart1"
runat="server"
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>
</form>
</body>
</html>
-
- Related Links
-
fa84142a-7e07-4d1c-b53b-fe66434119bc|0|.0