正在阅读:自定义个性化的web复合控件自定义个性化的web复合控件

2004-05-28 10:23 出处:CSDN 作者:feic 责任编辑:linjixiong

     修改第一个函数为下面代码


protected override void Render(HtmlTextWriter writer)

     {

         this.CreateChildControls();

         base.Render (writer);

     }

 

     修改第二个函数为下面代码


         protected override void CreateChildControls()

         {

              // 清除现有的子控件及其 ViewState

              this.Controls.Clear();

              this.ClearChildViewState();

              // 生成控件树         

              // 生成环境表格(一行,两个单元格)

              Table myTable          = new Table();

              //build the table row生成表格中的行

              TableRow row  = new TableRow();

              myTable.Rows.Add(row);

              // 生成单元格

              TableCell myCell = new TableCell();    

//用来生成链接按钮导航条的代码。每个按钮都显示有一个 Webdings 字符,可以根据需//禁用,并被绑定到内部的 Click 事件处理程序。


              LinkButton myLinkButton = new LinkButton();

 


察看评论详细内容 我要发表评论
作者笔名 简短内容 发表时间
:

键盘也能翻页,试试“← →”键

关注我们

最新资讯离线随时看 聊天吐槽赢奖品