在一国外网站看到的为了配合些jquery的表格插件需要thead和tbogy 原文地址http://justgeeks.blogspot.com/2008/09/add-tbody-and-thead-to-gridview.html protected void GridView1_PreRender(object sender, EventArgs e) { // You only need the following 2 lines of code if you are not // using an ObjectDataSource of SqlDataSource GridView1.DataSource = Sample.GetData(); GridView1.DataBind(); if (GridView1.Rows.Count > 0) { //This replaces <td> with <th> and adds the scope attribute GridView1.UseAccessibleHeader = true; //This will add the <thead> and <tbody> elements GridView1.HeaderRow.TableSection = TableRowSection.TableHeader; //This adds the <tfoot> element. //Remove if you don't have a footer row //加上原文这行好像有错去了就可以了 //GridView1.FooterRow.TableSection = TableRowSection.TableFooter; } }