----------图片下方--------------------
而正常的控件应该是:
===============
update by rock jing on 2004-9-25
===============
我定义了设计时的类,用来显示,设计时候控件显示的模样。
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 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;
}
}
}
结果,出现了创建控件出错。指定转换无效