473,402 Members | 2,072 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,402 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 3581
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.