如何在ASP.net C#中将HTML文本编辑器内容存储和检索到SQL Server DB

Nil*_*ils 1 c# asp.net sql-server-2008-r2 html-editor

我在C#项目的asp.net中使用HMTL文本编辑器。因此,如何将编辑器内容存储在SQl Server 2008 DB中,以便在网页上进行编辑时将其提取出来,这意味着在将数据提取到网页上时必须显示相同的编辑效果。

请帮忙

在此先感谢Nils

Kap*_*wal 5

您可以使用HtmlEncodeHtmlDecode

// Encode the content for storing in Sql server.
string htmlEncoded = WebUtility.HtmlEncode(text); 

// Decode the content for showing on Web page.
string original = WebUtility.HtmlDecode(htmlEncoded); 
Run Code Online (Sandbox Code Playgroud)