页面中设置了“ OnRowDeleting="List_RowDeleting" DataKeyNames="id"”
后台代码为:
行 178: protected void List_RowDeleting(object sender, GridViewDeletedEventArgs e)
行 179: {
行 180: string id = this.List.DataKeys[e.RowIndex].Value.ToString();
行 181: SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["SQLCONNECTIONSTRING"].ConnectionString);
行 182: con.Open(); 原因:参数错误,应该是GridViewDeleteEventArgs RowDeleted事件是GridViewDeletedEventArgs
RowDeleting事件是GridViewDeleteEventArgs 标签:RowIndex,List,RowDeleting,GridViewDeleteEventArgs,using,GridViewDeletedEventArgs From: https://www.cnblogs.com/Dongmy/p/17582284.html