首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

GridView 中生成了<thead><tbody>标记分页时报错解决方案

2013-09-25 
GridView 中生成了thead、tbody标记分页时报错解决方案由于项目需要,我让gridview在生成html代码时,带

GridView 中生成了<thead>、<tbody>标记分页时报错解决方案

由于项目需要,我让gridview在生成html代码时,带有<thead>、<tbody>标记,让Gridview带有此标记的代码如下:

  //protected void gvEquData_PreRender(object sender, EventArgs e)    //{        //if (gvEquData.Rows.Count > 0)        //{        //    // 使用<TH>替换<TD>        //    gvEquData.UseAccessibleHeader = true;        //    //This will add the <thead> and <tbody> elements        //    //HeaderRow将被<thead>包裹,数据行将被<tbody>包裹        //    gvEquData.HeaderRow.TableSection = TableRowSection.TableHeader;        //    // FooterRow将被<tfoot>包裹        //    gvEquData.FooterRow.TableSection = TableRowSection.TableFooter;        //}    //}

然而在Girdview中如果带有此标记,在分页时,会出现错误:“必须按以下顺序包含行节: 标题、正文和脚注。”解决方案是不使用Gridview自带的分页,而是使用第三方分页控件进行分页。如:AspNetPager

热点排行