Click here to Skip to main content
15,890,506 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
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
Posted
Comments
akshay25101988 3-Jul-14 2:39am    
2 possibility
basically i think
1.On page load have you set IsPostback property
for window check that data binding for CKeditor on button click
2.May be Third party Controller have not written code properly (less chance )
akshay25101988 3-Jul-14 5:45am    
:)

1 solution

I did not mention IsPostback in Pageload and that's why it wasn't updating my values.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900