2 u012322929 u012322929 于 2013.12.20 16:40 提问

GridView1.Rows[e.RowIndex].Cells[0].Text.ToString().Contains("")中到Text读不出值

protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
if (GridView1.Rows[e.RowIndex].Cells[0].Text.ToString().Contains("溜溜"))//Cells[0]是读不出内容 为1时没有问题
{
e.Cancel = true;
ClientScript.RegisterStartupScript(this.GetType(), "", "alert('不许删除!!!否则后果自负!!!');");
}
else
{
String no = GridView1.DataKeys[e.RowIndex].Value.ToString();
int i = bll.DelUsers(no);
if (i > 0)
{
Response.Write("alert('删除成功!!')");
binddata();
}
else
{
Response.Write("alert('删除失败!!')");
}
}
}

Csdn user default icon
上传中...
上传图片
插入图片