protected void gridViewAlbum_RowDeleting(object sender, GridViewDeleteEventArgs e) { try { GridViewRow row = gridViewAlbum.Rows[e.RowIndex]; Int32 AlbumID = Convert.ToInt32(((Label)row.Cells[0].FindControl("lblAlbumID")).Text); Gallery obj = new Gallery(); obj.DeleteAlbum(AlbumID); LoadGridViewAlbum(); } catch { } }
protected void btnDelete_Click(object sender, EventArgs e) { try { Int32 AlbumID = Globals.GetIntFromQueryString("AlbumID"); Gallery obj = new Gallery(); int kq = -1; kq = obj.DeleteAlbum(AlbumID); ShowMessage(kq, "xóa"); LoadGridViewAlbum(); } catch { } }