访问类出现错误?
System.Web.UI.WebControls.WebControl”的限定符访问保护成员“System.Web.UI.WebControls.WebControl.WebControl()”;限定符必须是类型“MetaBuilders.WebControls.ComboBox”(或者从该类型派生)的
怎么解决?
部分代码如下:
namespace MetaBuilders.WebControls
{
[
Designer(typeof(MetaBuilders.WebControls.ComboBoxDesigner)),//实现设计需要服务类
ValidationProperty("Text"), //标识元素属性的类
]
public class ComboBox : System.Web.UI.WebControls.ListControl, IPostBackDataHandler, INamingContainer
{
public ComboBox() : base() {}
..................
.............
private WebControl container;
private WebControl button;
private TextBox text;
........
protected override void CreateChildControls()
{
container = new WebControl(); //出现错误
container.ID="container";
this.Controls.Add( container );
text = new TextBox();
text.ID = "Text";
text.Attributes["autocomplete"] = "off";
container.Controls.Add( text );
text.TextChanged += new EventHandler( this.raiseTextChanged );
button = new WebControl(); //出现错误
button.ID = "Button";
container.Controls.Add( button );
}
怎么解决?