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 );
}
怎么解决?
部分代码如下: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 );
}
怎么解决?
解决方案 »
- 请教.net网站 连接数据库的问题
- 文章点击率
- 关于IHttpModule
- 截取字符串,请各位帮我下
- *********日期格式转换
- 各位高手帮忙看看!!!
- 电子商务网站的订单到底怎么数据库设计?我先分析一下,诸位再提点建议?!
- alibaba遇难了.
- 1.如何把数据库里面的数据记录全部删除只留一条记录2.查找记录中分数字段中最高分
- mvc+ef,更新数据时 报错 “attaching an entity of type xxx failed”
- 调查一下:你会递归算法吗?和遍历树型结构吗。如果不会这两个,你的工资会是多少?
- ASP.net 能否实现把指定网页保存到指定文件夹中?保存的结果要和执行IE的“另存为”命令一样
// CS1540.cs
public class Base
{
protected void func()
{
}
}public class Derived : Base
{
public static void test(Base anotherInstance)
// the method declaration could be changed as follows
// public static void test(Derived anotherInstance)
{
anotherInstance.func(); // CS1540
}
}public class Tester : Derived
{
public static void Main()
{
Base pBase = new Base();
// the allocation could be changed as follows
// Derived pBase = new Derived();
test(pBase);
}
}
倒了
初始化表示 Span HTML 标记的 WebControl 类的新实例。[Visual Basic] Protected Sub New()
[C#] protected WebControl();
[C++] protected: WebControl();
[JScript] protected function WebControl();
使用指定的 HTML 标记初始化 WebControl 类的新实例。[Visual Basic] Public Sub New(HtmlTextWriterTag)
[C#] public WebControl(HtmlTextWriterTag);
[C++] public: WebControl(HtmlTextWriterTag);
[JScript] public function WebControl(HtmlTextWriterTag);
使用指定的 HTML 标记初始化 WebControl 类的新实例。[Visual Basic] Protected Sub New(String)
[C#] protected WebControl(string);
[C++] protected: WebControl(String*);
[JScript] protected function WebControl(String);