protected void UpdateDetails_Click(object sender, EventArgs e) { string categoryName = tbCategoryName.Text; string categoryDesc = tbCategoryDesc.Text; bool categoryAvailable = cbCategoryAvailable.Checked; int categoryID = int.Parse(hdnCategoryID.Value); if (categoryName.Length >= 3 && categoryID > 0) { AdminCategories.UpdateCategoryDetails(categoryID, categoryName, categoryAvailable, categoryDesc); CategoryEdit.Visible = false; AddNewCategoryDiv.Visible = true; BindData(); lblMessage.Text = "Category was successfully updated. "; } else { lblMessage.Text = "Category Update Error: "; } }