protected void gridField_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "del") { if (info.DelInfoClass(e.CommandArgument.ToString())) { GridBind(); } } if (e.CommandName == "update") { DataTable dt = info.SelInfoClass(e.CommandArgument.ToString()); if (dt.Rows.Count > 0) { Dropfenlei.SelectedValue = dt.Rows[0]["sid0"].ToString(); txtfenleiName.Text = dt.Rows[0]["tClassName"].ToString(); txtnum.Text = dt.Rows[0]["nPaiXu"].ToString(); hid.Value = dt.Rows[0]["nID"].ToString(); tab.Visible = true; imgAdd.Visible = false; imgSub.Visible = true; } } }