自定义控件无法在VS.net编辑中显示
2004-09-25 10:46
369 查看
自己写了一个用户控件,拖入到编辑框只有如下图的样子,连鼠标都无法选中,怎么解决?
----------图片下方--------------------
public class SampleDesign
public class SampleDesigner : System.Web.UI.Design.ControlDesigner
public override string GetDesignTimeHtml()
// Component is the control instance, defined in the base
// designer
MyLabel myLable = (MyLabel)this.Component;
string html = myLable.GetHtml();
return html;
}
protected override string GetEmptyDesignTimeHtml()
String html = base.GetEmptyDesignTimeHtml ();
html = "<input type='text'"+html+">";
return html;
}
protected override string GetErrorDesignTimeHtml(Exception e)
String html = base.GetErrorDesignTimeHtml (e);
html = "<input type='text'"+html+">";
return html;
}
}
}
结果,出现了创建控件出错。指定转换无效
----------图片下方--------------------
public class SampleDesign
public class SampleDesigner : System.Web.UI.Design.ControlDesigner
public override string GetDesignTimeHtml()
// Component is the control instance, defined in the base
// designer
MyLabel myLable = (MyLabel)this.Component;
string html = myLable.GetHtml();
return html;
}
protected override string GetEmptyDesignTimeHtml()
String html = base.GetEmptyDesignTimeHtml ();
html = "<input type='text'"+html+">";
return html;
}
protected override string GetErrorDesignTimeHtml(Exception e)
String html = base.GetErrorDesignTimeHtml (e);
html = "<input type='text'"+html+">";
return html;
}
}
}
结果,出现了创建控件出错。指定转换无效
![](http://images.cnblogs.com/cnblogs_com/king_astar/Snap4.gif)
相关文章推荐
- 祝贺自己的blog开张
- Java 性能的优化
- Writing 1
- HiveMind 和 Spring 的比较 (之一)
- 如何用asp进行base64加密
- ASP 编程中20个非常有用的例子
- 开篇语:多做也要多说
- IT职业分类详解
- 美国计算机专业前20名学校点评
- 使用C#编写不同的"Hello World"程序(转)
- ATL接口映射宏详解
- Java 2 SE v 1.3 预定义包说明
- [推荐]开发高性能的 ASP.NET 应用程序(源自.NET Framework SDK 说明文档)
- C#规范漫谈 (转)
- 获得一个字符的ASCII值
- .net应用程序如何批上XP的外衣?
- 谁要GMail Invitation?
- Uniform Server简介
- 使用Delphi 7实现Splash窗体
- MyIM