示例#1
0
        protected override void RenderContent(HtmlTextWriter writer)
        {
            foreach (var child in this.Controls)
            {
                var literalControl = child as LiteralControl;

                if (literalControl != null)
                {
                    literalControl.Text = BindingUtility.FormatBindingValue(literalControl.Text, BindingUtility.GetBindingSource(literalControl));
                }
            }

            if (!string.IsNullOrWhiteSpace(this.Text))
            {
                if (this.TextEncoded)
                {
                    writer.WriteEncodedText(this.Text);
                }
                else
                {
                    writer.Write(this.Text);
                }
            }

            //调用基类同名方法(生成子控件集)
            base.RenderContent(writer);
        }
示例#2
0
 internal protected object GetBindingSource()
 {
     return(BindingUtility.GetBindingSource(this));
 }