protected void btnAdd_Click(object sender, EventArgs e) { try { ThemDT(txtMa.Text, txtTen.Text, int.Parse(txtGia.Text), txtPK.Text, txtLoai.Text); GridViewTab.DataSource = DSDienThoai(); GridViewTab.DataBind(); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Nhập vào thành công');", true); } catch { ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Nhập vào lỗi!');", true); } }
protected void bntXoa_Click(object sender, EventArgs e) { XoaDT(txtMa.Text); GridViewTab.DataSource = DSDienThoai(); GridViewTab.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { GridViewTab.DataSource = DSDienThoai(); GridViewTab.DataBind(); }