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