473,327 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Web Parts - Web Part zone

I have added a calendar control inside webpartzone, It works well but when i press the close it closes,but when I open the next time the same page i am not able to see the control (calendar) as i have closed it.Now if i need to get back the control (calendar) what should I do?

Expand|Select|Wrap|Line Numbers
  1. <asp:WebPartManager ID="WebPartManager1" runat="server">
  2.         </asp:WebPartManager>
  3.  
  4.         <asp:WebPartZone ID="WebPartZone1" runat="server" Height="230px" Style="z-index: 100;
  5.             left: 5px; position: absolute; top: 62px" Width="269px">
  6.             <ZoneTemplate>
  7.              <asp:Calendar ID="Calendar1" runat="server" Style="z-index: 102; left: 9px; position: absolute;
  8.             top: 98px"></asp:Calendar>
  9.             </ZoneTemplate>
  10.         </asp:WebPartZone>
This was the code that i have used
Jul 26 '08 #1
1 3577
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:
Expand|Select|Wrap|Line Numbers
  1. protected void DDloption_SelectedIndexChanged(object sender, EventArgs e)
  2.     {
  3.         if (DDloption.SelectedValue == "Design")
  4.         {
  5.             WebPartManager1.DisplayMode = WebPartManager.DesignDisplayMode;
  6.         }
  7.         else if (DDloption.SelectedValue == "Browse")
  8.         {
  9.             WebPartManager1.DisplayMode = WebPartManager.BrowseDisplayMode;
  10.         }
  11.         else if (DDloption.SelectedValue == "Catalog")
  12.         {
  13.             WebPartManager1.DisplayMode = WebPartManager.CatalogDisplayMode;
  14.         }
  15.         else if (DDloption.SelectedValue == "Edit")
  16.         {
  17.             WebPartManager1.DisplayMode = WebPartManager.EditDisplayMode;
  18.         }
  19.         else if (DDloption.SelectedValue == "Connect")
  20.         {
  21.             WebPartManager1.DisplayMode = WebPartManager.ConnectDisplayMode;
  22.         }
  23.     }
  24.  
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...
Aug 5 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Stephen | last post by:
I am looking at web parts controls in visual web developer. There seems to be something significantly different in beta 2 about these controls. First of all, the content web part control is gone,...
5
by: Michael Herman \(Parallelspace\) | last post by:
1. What are some compelling solutions for using Master/Content pages with Web Pages? 2. If a content area has a web part zone with web parts, what is the user experience like when "editting" the...
0
by: ian | last post by:
Hi, I am having problems formatting a web part zone when then zone appears within a content page. If I add a zone to a normal page, and auto format it then the zone appears as it should,...
0
by: tony dong | last post by:
Hi there I have web part function allow user to add web part to web part zone or move from one zone to other zone, but before they add or move, I want to check is the new zone size(width and...
0
by: Vince Varallo | last post by:
Is there anyway to prevent a postback event when a web part is moved into a different zone? I am using the MSNBC weather web part and it fires a java script which is causing an error because the...
0
by: Vince Varallo | last post by:
Is there anyway to prevent a postback event when a web part is moved into a different zone? I am using the MSNBC weather web part and it fires a java script which is causing an error because the...
0
by: Vince Varallo | last post by:
Is there anyway to prevent a postback event when a web part is moved into a different zone? I am using the MSNBC weather web part and it fires a java script which is causing an error because the...
1
by: mrsmitty | last post by:
Okay can't figure out how to get this to work? Works with a standard TextBox but not my user control? Help is much appreciated. Thanks. UserControl googleSearch = new UserControl();...
1
by: rudjohn | last post by:
I've been tasked with the not-enviable job of creating an application with multiple, semi-customizable templates. My basic concept, thus far, has been a combination of Master Pages (for layout) and...
0
by: tofu.captain | last post by:
I have an ASPX page that needs to read in form values (txtbox, dropdownlists, etc) from a custom control that redirects execution by crosspage postback. Here is the how it is being redirected: ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.