Web自己定义控件的问题
namespace Test.WebControl
{
[DefaultProperty( "Text ")]
[ToolboxData( " <{0}:StringItemDDL runat=server> </{0}:StringItemDDL> ")]
public class StringItemDDL : System.Web.UI.WebControls.DropDownList
{
[Bindable(false), Category( "Appearance "), DefaultValue( " ")]
#region Enable
public override bool Enabled
{
get
{
//生成时没错误,但把控件拖到aspx界面时会出错.
return this.Enabled;
}
set
{
//生成时没错误,但把控件拖到aspx界面时会出错.
this.Enabled = value;
}
}
#endregion
}
------解决方案--------------------沙发,帮忙顶吧
------解决方案-------------------- public override bool Enabled
{
get
{
return base.Enabled;
}
set
{
base.Enabled = value;
}
}
------解决方案--------------------public override bool Enabled
{
get
{
//生成时没错误,但把控件拖到aspx界面时会出错.
return this.Enabled;//这里会无穷递归 ,不出错才怪