vs2005中gridview的RowCommand事件

具体代码如下
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        
//e.CommandArgument获得命令行的索引
        if (e.CommandName == "SetNotice")
        {
            
if (!demo.methods(Convert.ToInt32(this.GridView1.DataKeys[Convert.ToInt32(e.CommandArgument)].Value),
            userid))
            {
                
base.MessageBox(string.Empty, OpNotice.strErrMsg);
            }
            
else
            {
                
base.MessageBox(string.Empty, "设置成功");
                DataBinds();
            }
        }
    }
原文地址:https://www.cnblogs.com/sjett/p/412909.html