how to show the controls for web user control in design time?

不羁岁月 提交于 2020-01-05 04:14:31

问题


this is what i had research in this few day, but i still cannot show the controls in design time... its keep show Type " System.Web.UI.UserControl does not have a public property name. The control is not showing while i have a inner property

Example .aspx code:

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

Example behind .ascx code:

 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);
                }
            }
        }

来源:https://stackoverflow.com/questions/10309086/how-to-show-the-controls-for-web-user-control-in-design-time

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!