r = new TableRow(); //生成新的一行 c = new TableCell(); //生成新的一列 c.Controls.Add(new LiteralControl("序號(hào)")); r.Cells.Add(c);
c = new TableCell(); //生成新的一列 c.Controls.Add(new LiteralControl("文章標(biāo)題")); r.Cells.Add(c);
c = new TableCell(); //生成新的一列 c.Controls.Add(new LiteralControl("閱讀次數(shù)")); r.Cells.Add(c); tableTest.Rows.Add(r); while(menuControl1.MyRead()){ r = new TableRow(); //生成新的一行
c = new TableCell(); //生成新的一列 c.Controls.Add(new LiteralControl(menuControl1.sRead["id"].ToString())); r.Cells.Add(c);
//欄目的標(biāo)題用 HyperLink 表示 HyperLink h=new HyperLink(); h.Text=menuControl1.sRead["title"].ToString(); h.NavigateUrl="viewarticle.aspx?id=" + menuControl1.sRead["id"].ToString(); c = new TableCell(); //生成新的一列 c.Controls.Add(h); r.Cells.Add(c);
c = new TableCell(); //生成新的一列 c.Controls.Add(new LiteralControl(menuControl1.sRead["viewnum"].ToString())); r.Cells.Add(c);