protected void btnUpdate_Click(object sender, EventArgs e) { try { Guid CurrentProductID = new Guid(Convert.ToString(Session["CurrentProductID"])); ProductsBL productsBL = new ProductsBL(); Product product = productsBL.GetProductByProductID(CurrentProductID); product.ProductName = txtProductName.Text; product.UnitPrice = Convert.ToDecimal(txtUnitPrice.Text); productsBL.UpdateProduct(product); Response.Redirect("~/Products.aspx"); } catch (Exception ex) { Response.Write(ex.Message); } }