【发布时间】:2018-04-23 07:44:47
【问题描述】:
我有一个带有 rowcommand 事件的 gridview。
我希望在我的行命令之外使用temp 字符串的值。
这可能吗?
protected void gwActivity_RowCommand(object sender, GridViewCommandEventArgs e)
{
GridViewRow row = ((e.CommandSource as Control).NamingContainer as GridViewRow);
string temp = row.Cells[1].Text;
}
【问题讨论】:
-
嗯,
this.Temp = temp;你想达到什么目的? -
是的.....要么将 temp 传递给任何需要的东西,因为范围当前意味着变量一旦生成就会消失。你可以让它成为课堂的一部分
标签: c# asp.net string gridview rowcommand