Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net 如何从GridView_RowUpdate事件捕获行数据_.net - Fatal编程技术网

.net 如何从GridView_RowUpdate事件捕获行数据

.net 如何从GridView_RowUpdate事件捕获行数据,.net,.net,我正在尝试创建一个日志表,该表捕获编辑/更新或删除的任何行的副本。 我可以很好地捕获编辑和删除行信息,但是RowUpdated事件捕获始终为空。我试图捕获的行的索引在RowUpdated上是正确的,但数据库中的行是空的 下面是RowCommand和RowUpdate的比较方法——它们基本相同,但功能似乎不同。任何帮助都将不胜感激,谢谢 protected void accountRatesGridView_RowCommand(object sender, GridViewCommand

我正在尝试创建一个日志表,该表捕获编辑/更新或删除的任何行的副本。 我可以很好地捕获编辑和删除行信息,但是RowUpdated事件捕获始终为空。我试图捕获的行的索引在RowUpdated上是正确的,但数据库中的行是空的

下面是RowCommand和RowUpdate的比较方法——它们基本相同,但功能似乎不同。任何帮助都将不胜感激,谢谢

    protected void accountRatesGridView_RowCommand(object sender, GridViewCommandEventArgs e)
    {

        string type = e.CommandName.ToString();
        int index = Convert.ToInt32(e.CommandArgument);
        while (accountRatesGridView.Rows[index] == null) { }
        GridViewRow row = accountRatesGridView.Rows[index];
        errorLabel2.Text = index.ToString();
        accountRatesLog(row, type);
    }

    protected void accountRatesGridView_RowUpdated(object sender, GridViewUpdatedEventArgs e)
    {
        accountRatesGridView.DataBind();
        string type = "Update";            
        GridViewRow row = accountRatesGridView.Rows[indexUpdate];
        accountRatesLog(row, type);
        errorLabel3.Text = row.ToString(); 

    }
    protected void accountRatesGridView_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {          
        indexUpdate = Convert.ToInt32(e.RowIndex); 
    }