谁能帮我吗!当用户单击按钮时,我在 gridview 中向用户显示角色和资格记录,在 gridview 中,我为每一行生成了“删除”按钮。当用户单击删除时,我想将角色和资格单元格值传递给消息框或弹出窗口。(我正在使用 visualstudio 2010 和 Dotnet 3.5)
我的 C# 代码:
protected void OnRowDelete_grid_admin(object sender, GridViewDeleteEventArgs e)
{
TableCell cell = grid_admin.Rows[e.RowIndex].Cells[0];
string CellValue = grid_admin.SelectedRow.Cells[0].Text;
string CellValue2 = grid_admin.SelectedRow.Cells[1].Text;
Response.Write("<script>alert('Are you sure to delete' + CellValue + Cellvalue2)</script>");
}