예제 #1
0
        protected override void CreateChildControls()
        {
            InternalLiteral     tb  = CreateLiteralControl();
            HTMLControlExtender ext = new HTMLControlExtender();

            ext.ControlID       = this.ControlID;
            ext.TargetControlID = tb.ID;

            Controls.Add(tb);
            Controls.Add(ext);

            base.CreateChildControls();
        }
예제 #2
0
        protected override void CreateChildControls()
        {
            InternalLiteral l = CreateLiteral();

            Controls.Add(l);

            IFrameControlExtender ext = new IFrameControlExtender();

            ext.ControlID       = this.ControlID;
            ext.TargetControlID = l.ID;

            Controls.Add(ext);

            base.CreateChildControls();
        }
예제 #3
0
        private InternalLiteral CreateLiteralControl()
        {
            InternalLiteral l = new InternalLiteral();

            l.ID = string.Concat(this.ControlID, "_htmlcontrol");
            if (State == ControlState.Designtime || State == ControlState.Preview)
            {
                l.Text = "<div>HTML will be output here</div>";
            }
            else
            {
                l.Text = HTML;
            }
            return(l);
        }
예제 #4
0
        private InternalLiteral CreateLiteral()
        {
            if (Scrolling == null)
            {
                Scrolling = "Auto";
            }

            InternalLiteral l = new InternalLiteral();

            l.ID = string.Concat(this.ControlID, "_iframe");
            if (State == ControlState.Designtime || State == ControlState.Preview)
            {
                StringBuilder item = new StringBuilder();
                item.AppendFormat("<div style='width:{0};height:{1};", _width, _height);
                if (IsVisible)
                {
                    item.Append("background:#F0F0F0;");
                }
                else
                {
                    item.Append("background:#C0C0C0;");
                }
                if (FrameBorder)
                {
                    item.Append("border:2px solid #000;");
                }
                else
                {
                    item.Append("border:1px dashed #000;");
                }
                if (string.Compare(Scrolling, "auto", true) == 0 || string.Compare(Scrolling, "yes", true) == 0)
                {
                    item.AppendFormat("overflow-y: {0};", Scrolling.ToLower());
                }
                item.Append("'>IFrame will show here</div>");

                l.Text = item.ToString();
            }
            else if (State == ControlState.Runtime)
            {
                l.Visible = IsVisible;
                l.Text    = string.Format("<iframe id='{0}_internalframe' width='{1}' height='{2}' src='{3}' scrolling='{4}' frameborder='{5}' ></iframe>", this.ControlID, _width, _height, this.URL, this.Scrolling.ToLower(), (this.FrameBorder == true) ? "1" : "0");
            }
            return(l);
        }