Creating a PopupControlExtender dynamically.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ata@mailinator.com

    Creating a PopupControlExtender dynamically.

    Hi,
    I need to create a PopupControlExt ender dynamically, and attach it to
    a LinkButton. i.e., when the LinkButton is clicked, I would like to
    display a given literal control to the user. So, I tried the following
    code:

    LinkButton link = new LinkButton();
    link.ID = "imgOtherAttrib utes" + caid;
    link.CausesVali dation = false;
    link.Text = "other options";

    LiteralControl lit2 = new LiteralControl( );
    lit2.ID = "popupWnd" + caid;
    lit2.Text = "<div style='display: none;width:200p x;height:
    200px;backgroun d-color:red;'>tes t</div>";

    AjaxControlTool kit.PopupContro lExtender popup = new
    AjaxControlTool kit.PopupContro lExtender();
    popup.ID = "popup" + caid;
    popup.TargetCon trolID = link.ID;
    popup.PopupCont rolID = lit2.ID;
    popup.Position = AjaxControlTool kit.PopupContro lPopupPosition. Right;

    However, the LiteralControl isn't shown!

    Any idea?

    Thanks
    Jack
  • bruce barker

    #2
    Re: Creating a PopupControlExt ender dynamically.

    did you add the new controls to the page? just creating a control will
    not cause cause it to render, you must add to the page control
    collection, or the collection of some container (the placeholder was
    designed for this).

    -- bruce (sqlwork.com)

    ata@mailinator. com wrote:
    Hi,
    I need to create a PopupControlExt ender dynamically, and attach it to
    a LinkButton. i.e., when the LinkButton is clicked, I would like to
    display a given literal control to the user. So, I tried the following
    code:
    >
    LinkButton link = new LinkButton();
    link.ID = "imgOtherAttrib utes" + caid;
    link.CausesVali dation = false;
    link.Text = "other options";
    >
    LiteralControl lit2 = new LiteralControl( );
    lit2.ID = "popupWnd" + caid;
    lit2.Text = "<div style='display: none;width:200p x;height:
    200px;backgroun d-color:red;'>tes t</div>";
    >
    AjaxControlTool kit.PopupContro lExtender popup = new
    AjaxControlTool kit.PopupContro lExtender();
    popup.ID = "popup" + caid;
    popup.TargetCon trolID = link.ID;
    popup.PopupCont rolID = lit2.ID;
    popup.Position = AjaxControlTool kit.PopupContro lPopupPosition. Right;
    >
    However, the LiteralControl isn't shown!
    >
    Any idea?
    >
    Thanks
    Jack

    Comment

    Working...