protected void btnSave_Click(object sender, EventArgs e) { iID = inumlbl.Text; iCategory = CategoryList.SelectedValue.ToString(); iName = iNameBox.Text; iPPrice = pPriceBox.Text; iRPrice = rPriceBox.Text; iNote = notebox.Text; iImage = imgURL.Text; iQuantity = qtyList.SelectedValue.ToString(); CsItem oldItemInfo = new CsItem(iID, iCategory, iName, iPPrice, iRPrice, iNote, iImage, iQuantity, iRday); try { ConnectionClass.UpdateItemDetail(oldItemInfo); ClientScript.RegisterStartupScript(GetType(), "message", "<script>alert('Updated!');</script>"); } catch { ClientScript.RegisterStartupScript(GetType(), "message", "<script>alert('Update failed');</script>"); } finally { DisableTextBoxes(Page); btnUpload.Visible = false; } }