Hi all
I have spent Alot time working with the edit radcotrol and I have followed the example in the documentation and I am have a hard time getting the radedit1.content to save
there is the code
string sqlserver = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
string user_id;
protected void Page_Load(object sender, EventArgs e)
{
string userID = Context.User.Identity.Name;
lookupid(userID);
getbody(user_id);
}
public void getbody(string userID)
{
SqlConnection conmydata = new SqlConnection(sqlserver);
conmydata.Open();
SqlCommand cmdselect = new SqlCommand("select txtarea from txtbody where @userID=userID", conmydata);
cmdselect.Parameters.AddWithValue(
"@userID", userID);
string strbody = Convert.ToString(cmdselect.ExecuteScalar());
conmydata.Close();
RadEditor1.Content = strbody;
}
public void lookupid(string userID)
{
SqlConnection conmydata = new SqlConnection(sqlserver);
conmydata.Open();
SqlCommand cmdselect2 = new SqlCommand("select userID from users where @userID=email_address", conmydata);
cmdselect2.Parameters.AddWithValue(
"@userID", userID);
string stremail = Convert.ToString(cmdselect2.ExecuteScalar());
conmydata.Close();
user_id = stremail;
}
public void edit_finish(object sender, EventArgs e)
{
string body = RadEditor1.Content;
SqlConnection conmydata = new SqlConnection(sqlserver);
conmydata.Open();
SqlCommand insert = new SqlCommand("update txtbody set txtarea=@txtarea where userID=@userID", conmydata);
insert.Parameters.AddWithValue(
"@txtarea", body);
insert.Parameters.AddWithValue(
"userID", user_id);
insert.ExecuteNonQuery();
conmydata.Close();
}


<%@ Page Title="Users | Telerik Trial Testing" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Users.aspx.cs" Inherits="TelerikTrial.Users" %><asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="server"></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <telerik:RadComboBox ID="App_List" runat="server" AutoPostBack="true" DataTextField="ApplicationName" DataValueField="LoweredApplicationName" OnSelectedIndexChanged="App_List_SelectedIndexChanged"> </telerik:RadComboBox> <br /> <telerik:RadAjaxManager runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="App_List"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="App_List" /> <telerik:AjaxUpdatedControl ControlID="User_List" LoadingPanelID="RadAjaxLoadingPanel1" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="User_List"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="App_List" /> <telerik:AjaxUpdatedControl ControlID="User_List" LoadingPanelID="RadAjaxLoadingPanel1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" /> <telerik:RadGrid ID="User_List" runat="server" AllowPaging="True" AutoGenerateColumns="False" GridLines="None" Skin="Windows7" OnPageIndexChanged="User_List_PageIndexChanged"> <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle> <MasterTableView EditMode="PopUp" CommandItemDisplay="Top" DataKeyNames="UserName"> <EditFormSettings InsertCaption="Add new user" CaptionFormatString="Edit User: {0}" CaptionDataField="UserName" PopUpSettings-Modal="true" /> <Columns> <telerik:GridEditCommandColumn /> <telerik:GridClientDeleteColumn /> <telerik:GridBoundColumn DataField="UserName" ReadOnly="true" /> <telerik:GridBoundColumn DataField="Email" /> <telerik:GridBoundColumn DataField="LastLoginDate" ReadOnly="true" /> <telerik:GridCheckBoxColumn DataField="IsLockedOut" /> </Columns> </MasterTableView> <ClientSettings> <ClientEvents OnRowDblClick="RowDblClick" /> </ClientSettings> </telerik:RadGrid></asp:Content><%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.Master.cs" Inherits="TelerikTrial.Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head id="Head1" runat="server"> <title></title> <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" /> <asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server"> </asp:ContentPlaceHolder> <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" /></head><body> <form id="form1" runat="server"> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> <Scripts> <asp:ScriptReference Path="~/Scripts/Common/Core.js" /> <asp:ScriptReference Path="~/Scripts/Common/jQuery.js" /> <asp:ScriptReference Path="~/Scripts/Common/jQueryInclude.js" /> <asp:ScriptReference Path="~/Scripts/Ajax/Ajax.js" /> <asp:ScriptReference Path="~/Scripts/XmlHttpPanel/RadXmlHttpPanel.js" /> <asp:ScriptReference Path="~/Scripts/Grid/RadGridScripts.js" /> <asp:ScriptReference Path="~/Scripts/ComboBox/RadComboBoxScripts.js" /> </Scripts> </telerik:RadScriptManager> <div class="page"> <div class="header"> <div class="title"> <h1> Telerik Trial </h1> </div> <div class="clear hideSkiplink"> <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal"> <Items> <asp:MenuItem NavigateUrl="~/Default.aspx" Text="Default" /> <asp:MenuItem NavigateUrl="~/Users.aspx" Text="Users" /> </Items> </asp:Menu> </div> </div> <div class="main"> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder> </div> <div class="clear"> </div> </div> <div class="footer"> </div> </form></body></html>using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using Telerik.Web.UI;namespace TelerikTrial{ public partial class Users : System.Web.UI.Page { private void Bind_User_List(String AppName = "default") { if (ViewState["AppName"] != null) AppName = (String)ViewState["AppName"]; User_List.DataSource = new DataProvider().ObtainAllMembershipAPIUsers(AppName); // Returns a Dataset from a sql server 2k8 stored procedure... User_List.DataBind(); } protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { App_List.DataSource = new DataProvider().ObtenerTodasLasAplicaciones(); App_List.DataBind(); this.Bind_User_List(); ViewState["AppName"] = App_List.SelectedItem.Value; } } protected void App_List_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e) { ViewState["AppName"] = App_List.SelectedItem.Value; User_List.CurrentPageIndex = 0; this.Bind_User_List(); } protected void User_List_PageIndexChanged(object sender, GridPageChangedEventArgs e) { User_List.CurrentPageIndex = e.NewPageIndex; this.Bind_User_List(); } }}