把值放给Button 的CommandArgument属性
Text="删除" OnClientClick="return confirm('确认要删除吗?');" />
取值
protected void GridView2_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "DeleteCourse")
{
string CourseCode= e.CommandArgument.ToString()
}
}