Ejemplo n.º 1
0
        //删除
        protected void dgCars_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int CarId = Convert.ToInt32(dgCars.DataKeys[e.RowIndex].Value);

            if (cm.DelCarById(CarId) > 0)
            {
                bindCars();
            }
        }
Ejemplo n.º 2
0
        protected void gvCars_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            try
            {
                int CarId = Convert.ToInt32(gvCars.DataKeys[e.RowIndex].Value);

                if (cm.DelCarById(CarId) > 0)
                {
                    bindCars();
                    ClientScript.RegisterStartupScript(this.GetType(), "ad", "alert('删除成功!!')", true);
                }
            }
            catch (Exception ex)
            {
                lblInfo.Text = ex.Message;
            }
        }