Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 编程语言 > .NET > C#.NET > table循环显示记录
【标  题】:table循环显示记录
【关键字】:table
【来  源】:http://blog.csdn.net/burningcpu/archive/2006/12/07/1434145.aspx

table循环显示记录

Your Ad Here   // Total number of rows
   int rowCnt;
   // Current row count
   int rowCtr;
   // Total number of cells per row (columns)
   int cellCtr;
   // Current cell counter
   int cellCnt;


   rowCnt = int.Parse(TextBox1.Text);
   cellCnt = int.Parse(TextBox2.Text);
   

   for(rowCtr=1; rowCtr <= rowCnt; rowCtr++)
   {
    // Create new row and add it to the table.
    TableRow tRow = new TableRow();
    Table1.Rows.Add(tRow);
    for (cellCtr = 1; cellCtr <= cellCnt; cellCtr++)
    {
     // Create a new cell and add it to the row.
     TableCell tCell = new TableCell();
     tRow.Cells.Add(tCell);              
     // Mock up a product ID.
     string prodID = rowCtr + "_" + cellCtr;

     // Add a literal text as control.
     tCell.Controls.Add(new LiteralControl("Buy: "));
    
     // Create Hyperlink Web Server control and add to cell
     System.Web.UI.WebControls.HyperLink h = new HyperLink();

     h.Text = rowCtr + ":" + cellCtr;
     h.NavigateUrl = "http://www.microsoft.com/china/net";
     tCell.Controls.Add(h);
    
    }
   }

 
Table Web 服务器控件显示数据库信息:【上一篇】
动态菜单树实现方式:【下一篇】
【相关文章】
  • Table Web 服务器控件显示数据库信息
  • c 語言hash table其實並不復雜
  • javascript删除table的行或列
  • C++中的mutable关键字
  • The best way to configure the student course table in Hibernate
  • table的宽度,单元格内换行问题
  • 微软正式推出.NET Framework 3.0 Redistributable Package
  • C#中使用HashTable
  • Portable Java IDE 2.0 提供打包下载
  • ORA-00942: table or view does not exist
  • 【随机文章】
  • BSTR详解四 - BSTR包容类
  • 各种排序算法java实现
  • ssh连接不需要密码
  • GPRS简介
  • WebComputing━ADO总结报告(7)
  • 因为那魔鬼看着顺眼
  • Linux下G4L硬盘备份方案
  • I-CDMA技术:提供无线因特网体验
  • 光口,光功率介绍
  • Java Web开发基础入门(二)——Servlet简介
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 软讯网络 All Rigths Reserved.