protected void btnSave_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(ItemID)) return; using (iMascotModelDataContext SaveTheDateDB = new iMascotModelDataContext(SaveTheDateConnection)) { var Item = SaveTheDateDB.PageContents.FirstOrDefault(ab => ab.ContentID.ToString() == ItemID); if (Item == null) { PageContent pageCont = new PageContent { ContentID = Guid.NewGuid(), PageName = txtPageTitle.Text, Content = CKEditor1.Text }; SaveTheDateDB.PageContents.InsertOnSubmit(pageCont); } else { Item.Content = CKEditor1.Text; Item.PageName = txtPageTitle.Text; } SaveTheDateDB.SubmitChanges(); } Response.Redirect("PageList.aspx"); }
partial void DeletePageContent(PageContent instance);
partial void UpdatePageContent(PageContent instance);
partial void InsertPageContent(PageContent instance);