gridview怎么获取当前行某列的值 详细如下:

2024-12-03 14:45:03
推荐回答(1个)
回答1:

把值放给Button 的CommandArgument属性
'

Text="删除" OnClientClick="return confirm('确认要删除吗?');" />

取值
protected void GridView2_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "DeleteCourse")
{
string CourseCode= e.CommandArgument.ToString()
}
}