0

これが私のコードです:

protected void Page_Load(object sender, EventArgs e)
{
    Button btn = new Button();
    btn.Text = "Button";
    btn.ID = "Button1";
    pnlMain.Controls.Add(btn);
    Panel pnl = new Panel();
    pnl.ID = "pnl";
    Label lbl = new Label();
    lbl.ID = "lbl";
    lbl.Text = "Hi this is my Balloon popup";
    pnl.Controls.Add(lbl);
    pnlMain.Controls.Add(pnl);
    BalloonPopupExtender  balloonPopupExtender1= new BalloonPopupExtender();
    balloonPopupExtender1.TargetControlID = btn.ID;
    balloonPopupExtender1.BalloonPopupControlID = pnl.ID;
    balloonPopupExtender1.BalloonSize = BalloonPopupSize.Small;
    balloonPopupExtender1.BalloonStyle = BalloonPopupStyle.Rectangle;
    balloonPopupExtender1.DisplayOnMouseOver = true;
    balloonPopupExtender1.DisplayOnClick = true;
    balloonPopupExtender1.DisplayOnFocus = false;
}

このコードは正しく実行されますが、バルーンポップアップが表示されません...

4

1 に答える 1

0

私は解決策を持っています

               Panel pnlBalloon = new Panel();
                pnlBalloon.ID="pnlBalloon";
                Label LblBalloon = new Label();
                LblBalloon.ID="LblBalloon";
                pnlBalloon.Controls.Add(LblBalloon);

                pnl_Message.Controls.Add(pnlBalloon);

                LblBalloon.Text = "This is Balloon Popup";

AjaxControlToolkit.BalloonPopupExtender BalloonPopupExtender1 = new AjaxControlToolkit.BalloonPopupExtender();

                BalloonPopupExtender1.ID = "BalloonPopupExtender1";
                BalloonPopupExtender1.TargetControlID = labelShow.ID;
                BalloonPopupExtender1.BalloonPopupControlID = pnlBalloon.ID;
                BalloonPopupExtender1.BalloonSize = AjaxControlToolkit.BalloonPopupSize.Small;
                BalloonPopupExtender1.BalloonStyle = AjaxControlToolkit.BalloonPopupStyle.Rectangle;
                BalloonPopupExtender1.Position = AjaxControlToolkit.BalloonPopupPosition.BottomRight;
                BalloonPopupExtender1.DisplayOnClick = false;
                BalloonPopupExtender1.DisplayOnMouseOver = true;
                BalloonPopupExtender1.DisplayOnFocus = false;
                pnlConnection.Controls.Add(BalloonPopupExtender1);
于 2012-11-23T08:40:51.157 に答える