protected void gvData_RowCommand(object sender, GridViewCommandEventArgs e) { string commandName = e.CommandName; int id = e.CommandArgument.ToArrowInt(); if (e.CommandName == "UpdateData") { Response.Redirect("GoodsEdit.aspx?id=" + id + CreateReturnUrl("&")); } else if (e.CommandName == "SetOut") { //下架 GoodsBLL.ChangeGoodsStatus(id, 1); } else if (e.CommandName == "Restore") { //上架 GoodsBLL.ChangeGoodsStatus(id, 0); } BindData(); MessageBox.Show("操作成功!"); }