protected void btnSave_Click(object sender, EventArgs e) { if (lblProductID.Text != null || lblProductID.Text != string.Empty) { NORTHWNDEntities nwe = new NORTHWNDEntities(); int productID = int.Parse(lblProductID.Text); Product product_edited = nwe.Products.Where(p => p.ProductID == productID).SingleOrDefault(); product_edited.Description = System.Web.Security.AntiXss.AntiXssEncoder.HtmlEncode(tbxDescription.Text, false); nwe.SaveChanges(); } }
protected void btnSave_Click(object sender, EventArgs e) { if (lblProductID.Text != null || lblProductID.Text != string.Empty) { NORTHWNDEntities nwe = new NORTHWNDEntities(); int productID = int.Parse(lblProductID.Text); Product product_edited = nwe.Products.Where(p => p.ProductID == productID).SingleOrDefault(); product_edited.Description = System.Web.Security.AntiXss.AntiXssEncoder.HtmlEncode(tbxDescription.Text,false); nwe.SaveChanges(); } }