コード例 #1
0
 protected void btnXoa_Click(object sender, EventArgs e)
 {
     LinkButton lbt = (LinkButton)sender;
     HiddenField h = (HiddenField)lbt.FindControl("hfID");
     clsTheLoai tl = new clsTheLoai();
     tl.Id = Convert.ToInt32(h.Value);
     clsBSTheLoai t = new clsBSTheLoai();
     if (t.DelTL(tl))
     {
         lblMes.Text = "<script>alert('Danh mục phụ đã được xóa');</script>";
         mtvTheLoai.ActiveViewIndex = 0;
         grvTheLoai.DataBind();
     }
     else
     {
         lblMes.Text = "<script>alert('Lỗi, không thể xóa !');</script>";
     }
 }