To bring back the closed webparts in to the page again follow the content,
use different modes for using the WebPart zones effectively.
The Modes are,
1.Design
2.Edit
3.Browse
4.Catalog
5.Connect
Just put down these modes into Dropdown list and implement the following code:
-
protected void DDloption_SelectedIndexChanged(object sender, EventArgs e)
-
{
-
if (DDloption.SelectedValue == "Design")
-
{
-
WebPartManager1.DisplayMode = WebPartManager.DesignDisplayMode;
-
}
-
else if (DDloption.SelectedValue == "Browse")
-
{
-
WebPartManager1.DisplayMode = WebPartManager.BrowseDisplayMode;
-
}
-
else if (DDloption.SelectedValue == "Catalog")
-
{
-
WebPartManager1.DisplayMode = WebPartManager.CatalogDisplayMode;
-
}
-
else if (DDloption.SelectedValue == "Edit")
-
{
-
WebPartManager1.DisplayMode = WebPartManager.EditDisplayMode;
-
}
-
else if (DDloption.SelectedValue == "Connect")
-
{
-
WebPartManager1.DisplayMode = WebPartManager.ConnectDisplayMode;
-
}
-
}
-
Browse Mode:
Browse mode is the default mode of web parts. In browse mode, you cannot drag and drop the web parts but you can see two options, minimize and close. Minimizing a web part will still show it, but in a minimized state.
Design Mode:
In design mode, you can drag drop objects between web parts.
Edit Mode:
you can edit web parts at runtime as well.
Catalog Mode:
Catalog mode gives you the option to add/remove web parts at runtime
Connect mode:
This mode allows web parts to communicate with each other
Add webpart manager ,webpart zones and add a catalog zone to the page then only you can bring the closed controls back to the screen.Catalog zone give us option to add and remove webparts at runtime.Catalog zone consists of three parts
1)PageCatalogPart
2)DeclarativeCatalogPart
3)ImportCatalogPart
add these three things in to the catalogZone from toolbar.
PageCatalogPart-Displays number of webparts closed by the user.
DeclarativeCatalogPart-Displays the number of elements that are added in design mode to catalog zone.
ImportCatalogPart:Displays the element selected for import.
After adding these three catalog parts inside the catalog zone.The pagecatalog inside the catalogzone will display you the closed webparts just select the web parts and click add button which will display you the closed webparts again.
(Choose catalog mode in the DropDownList at runtime to view catalogzone
on the screen)
I hope this helps you...