I used CKEditor ASP.NET version and adjust to my writing space. When click btn_Post
button, then should post written text in this editor field. I want to get this text in C# because for saving at database. So I searched how to use(here) and found the way using HtmlEncode. Here is codes what I found.
asp
<div>
<CKEditor:CKEditorControl ID="CKEditor1" BasePath="/ckeditor/" runat="server">
</CKEditor:CKEditorControl>
</div>
<div style="margin-top:10px; float:right;">
<asp:button ID="btn_Post" runat="server" Text="등록하기" CssClass="btn_Post" onclick="btn_Post_Click" />
</div>
CS
string str = CKEditor1.Text;
string str1 = Server.HtmlEncode(str);
string str2 = Server.HtmlDecode(str);
//str = <p>1234</p>\r\n
//str1 = <p>1234</p>\r\n
//str2 = <p>1234</p>\r\n
But the problem is, I need to save text with none html codes. As you can see, all variable shows html code. How can I change this result to pure text 1234
?