问题
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