// Insert new content for datalist protected void InsertContent(object sender, EventArgs e) { contentClass objContent = new contentClass(); objContent.ContentPage = txt_pageI.Text.ToString(); objContent.ContentText = txt_textI.Text.ToString(); lbl_msg2.Text = objContent.insertContent(); _subBind(); _subBindDataList(); }
// inserts new content protected void contentItemInserting(object sender, FormViewInsertEventArgs e) { TextBox txtPage = (TextBox)fmv_content.FindControl("txt_pageI") as TextBox; TextBox txtText = (TextBox)fmv_content.FindControl("txt_textI") as TextBox; contentClass objContent = new contentClass(); objContent.ContentPage = txtPage.Text.ToString(); objContent.ContentText = txtText.Text.ToString(); lbl_msg.Text = objContent.insertContent(); fmv_content.ChangeMode(FormViewMode.ReadOnly); _subBind(); _subBindDataList(); // both binds are here to update both data bound controls }