Ajax PopupExtender Problem

Eduardo Lorenzo

Regular
Joined
Jun 27, 2006
Messages
87
Hi everyone, it is nice to be back.

Again, of course with a question.

I am having a problem using AJAX popup extender. I create a panel(to hold all controls), a label(the one to click to popup), another panel(to hold the popup content, a literal(with the popup content), an Ajax popupextender, and assign the values, all on the fly like so:

Visual Basic:
 Panel displayPanel1 = new Panel();
                        displayPanel1.BackColor = System.Drawing.Color.White;
                        displayPanel1.ID = "dispPanel" + myCounter.ToString();
                        displayPanel1.Controls.Add(hc);
                        AjaxControlToolkit.PopupControlExtender myPop = new AjaxControlToolkit.PopupControlExtender();
                        myPop.TargetControlID = desclabel.ID;
                        myPop.PopupControlID = displayPanel1.ID;
                        myPop.ID = "pop" + myCounter.ToString();
                        detailsPanel.Controls.Add(myPop);
                        detailsPanel.Controls.Add(displayPanel1);

hc is the literal, there is nothing wrong there. displaypanel is the main panel instantiated also by code.

what happens here is when the page renders, displayPanel1 is already visible! And when I click on the label, it "pops" up to its correct place. and when I click anywhere else on the page, it dissapears and then starts to function properly (as a popup should).

I tried setting the visibility property of detailsPanel1 to false but it does not work.

All help will be greatly appreciated. Thanks in advance.
 
Back
Top