如何在设计时显示Web用户控件的控件?

时间:2012-04-25 03:46:02

标签: c# asp.net webusercontrol

这是我在这几天研究的内容,但我仍然无法在设计时间内显示控件......它的显示类型" System.Web.UI.UserControl没有公共属性名称。当我有内在属性时,控件没有显示

示例.aspx代码:

<XF:XFButton ID="XFButton1" runat="server" >
    <Button1 ClientSideEvents-Click = "function(s,e){ApplyJavascript();}"></Button1>
 </XF:XFButton>

.ascx代码背后的示例:

 namespace XESControlsTestApp.WebControl
    {
        [PersistenceMode(PersistenceMode.InnerProperty)]
        [ParseChildren(true)]
        [Browsable(true)]

        public class ContentContainer : Control, INamingContainer {

            private ITemplate _content;
            public ITemplate ContentTemplate
            {
                get { return this._content; }
                set { this._content = value; }
            }

            protected override void OnInit(EventArgs e)
            {
                base.OnInit(e);

                if (this._content != null)
                {
                    ContentContainer container = new ContentContainer();
                    this._content.InstantiateIn(container);
                    this._content.InstantiateIn(this);
                }
            }
        }

0 个答案:

没有答案