Hi! All
I'm trying to update the text of CKEditor using my ADO.Net code:
I followed this link[
^] to setup the ckeditor in my application.
I'm calling the following method from the update button click event.
Following is my code
public void updatetext()
{
SqlConnection _SqlConnection = new SqlConnection(GetConnectionString());
try
{
string sqlStatement = string.Empty;
int ID = 2;
string _textstring = CKEditor1.Text;
string str1 = Server.HtmlEncode(_textstring);
string str2 = Server.HtmlDecode(str1);
_textstring = str2;
sqlStatement = "UPDATE Marquee SET MarqueeText = N'" + _textstring + "'";
_SqlConnection.Open();
SqlCommand cmd = new SqlCommand(sqlStatement, _SqlConnection);
cmd.Parameters.AddWithValue("@ID", ID);
cmd.CommandType = CommandType.Text;
cmd.ExecuteNonQuery();
LoadMarqueeText();
}
catch (Exception _Exception)
{
throw _Exception;
}
finally
{
_SqlConnection.Close();
_SqlConnection.Dispose();
}
}
When I change some text and when I click on Update button click event it doesn't show the changed text instead it show the old values. How can I Fix this?
Can any one please help me out with this?
Thanks