473,327 Members | 2,012 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 Part Minimize

When I dynamically add Web parts to my code On Minimize event web part
get deleted.
My WebPartZone, WebPartManager is defined in MasterPage
I want to programatically add control to my Web Part.

Code is as follows.

Kindly Help

protected void Page_Load(object sender, EventArgs e)
{
WebPartZone wz =
(WebPartZone)Master.FindControl("WebPartZone1");
// WebPartZone wz2 =
(WebPartZone)Master.FindControl("WebPartZone2");
// string s = wz.WebParts.Count.ToString();
WebPartManager wm =
(WebPartManager)Master.FindControl("WebPartManager 1");
Control con = LoadControl("WebUserControl.ascx");
con.ID = "userControl";
GenericWebPart wp = wm.CreateWebPart(con);
wp.ID = "w1";
wp.AllowEdit = true;
if (! IsPostBack )
wm.AddWebPart(wp, wz, 0);

wm.DisplayMode = WebPartManager.DesignDisplayMode;
}

Jun 1 '06 #1
0 1021

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Erik Bethke | last post by:
Hello All, I now have a wx.NO_BORDER frame that I have written dragging code for... I like my window this way as it looks sleeker and I am now installing some image buttons. Now I would like...
2
by: Tony Ciconte | last post by:
I cannot seem to find the VBA code that will minimize the whole Access apllication. The instruction... "Application.DoCmd.Minimize" seems to only minimize the active screen. What I need is a VBA...
3
by: Maka Sili | last post by:
Hi, My VC++ application does not have a titlebar (and therefore no System menu, no minimize, no maximize and no close button). We have a custom button for minimize and close. When the app...
3
by: Don | last post by:
If you have a form that calls another form via the following code: Dim myForm as Form2 myForm = New Form2 myForm.Owner = Me MyForm.ShowDialog and you minimize the second form, the first form...
3
by: envyisevil | last post by:
This article is dedicated to: A man I met, with most of his body heavily burned, simply because he was a Chinese during the 1998 May Riot in Indonesia. Lots of capitalists that are slaughtered...
1
by: zakhirn | last post by:
Anyone have code that creates a button that will Minimize Excel to the system tray. I do not need anything complicated like changing the minimize button or the close button to a minimize to...
4
by: EmilH | last post by:
Hi, Can anybody show me how to minimize/maximize a window dynamically? I placed buttons for each of these commands and want to place the code which will minimize and maximize the window. ...
0
by: mrajeshbabu | last post by:
hi, can i minimize the web part when the pge is loaded and when a dropdownlist is clicked i want to maximize it is it possible pls help me
5
by: =?Utf-8?B?SmFtZXMgV29uZw==?= | last post by:
Dear all, I'd like to know if there is any method to minimize command mode window when a console program is running. In my case, there are several console programs which run periodically in...
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...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.