日期:2014-05-20  浏览次数:20951 次

获取table控件中某列的值时出错,索引超出范围~
获取table控件中某列的值时出错,提示index超出范围.

table控件为4行10列,其中第2列是控件DropDownList,其他全为TextBox
Response.Write(((TextBox)table1.Rows[0].Cells[0].Controls[0]).Text),没问题.
Response.Write(((DropDownList)table1.Rows[0].Cells[1].Controls[0]).SelectedValue),提示错误,index超出范围.
环境:vs2003+XP+asp.net程序,希望高手帮忙!

------解决方案--------------------
先输出看看
Response.Write(table1.Rows[0].Cells.Count);