Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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:

 

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...