问题描述
代码如下:publicclassCustomButton:Button{publicCustomButton(){this.Text="ClickHere";}/*[DefaultProperty("Text")][ToolboxData("<{0}:WebCustomControl1runat=server></{0}:WebCustomControl1>")]publicclassWebCustomControl1:System.Web.UI.WebControls.Button{publicWebCustomControl1(){this.Text="ClickHere";}*/protectedoverridevoidRenderContents(HtmlTextWriteroutput){base.Render(output);}protectedoverridevoidRender(HtmlTextWriterwriter){writer.AddStyleAttribute(HtmlTextWriterStyle.BorderWidth,"1");writer.RenderBeginTag(HtmlTextWriterTag.Table);writer.RenderBeginTag(HtmlTextWriterTag.Tr);writer.AddAttribute(HtmlTextWriterAttribute.Bgcolor,"Black");writer.RenderBeginTag(HtmlTextWriterTag.Td);writer.Write("<p>bu</p>");writer.RenderEndTag();writer.RenderEndTag();writer.RenderEndTag();}protectedoverridevoidOnClick(EventArgse){//TODO:添加ConfirmButton.OnClick实现base.OnClick(e);}}谢谢!