读书人

.net 2005 的GridView 的模板列中怎

发布时间: 2012-02-09 18:22:27 作者: rapoo

.net 2005 的GridView 的模板列中,如何取得当前行?
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{


if (e.CommandName == "del ")
{
int a = Convert.ToInt32(e.CommandArgument);
GridViewRow row = GridView1.Rows[a];
string xh3 = row.Cells[0].Text;
ClientScript.RegisterStartupScript(typeof(Page), " ", " <script> alert( ' "+xh3+ " '); </script> ");
}
}
为什么提出来的是空值?

[解决办法]
第一列有没有文字?还是控件?如果是控件就要用findcontrol

读书人网 >asp.net

热点推荐