You can use below code to show as HTML in web page and save in database as text.
public static string ConvertToHTML(string HtmlText)
{
HtmlText = HtmlText.Replace("\r\n", "\r");
HtmlText = HtmlText.Replace("\n", "\r");
HtmlText = HtmlText.Replace("\r\r", "<p>");
HtmlText = HtmlText.Replace("\r", "<br>");
return HtmlText;
}
public static string ConvertHTMLtoText(string HtmlText)
{
HtmlText = HtmlText.Replace ("\r","\n");
HtmlText = HtmlText.Replace( "<p>","\r\r");
HtmlText = HtmlText.Replace( "<br>","\r");
HtmlText = HtmlText.Replace("\r", "\r\n");
return HtmlText;
}
public static string ConvertToHTML(string HtmlText)
{
HtmlText = HtmlText.Replace("\r\n", "\r");
HtmlText = HtmlText.Replace("\n", "\r");
HtmlText = HtmlText.Replace("\r\r", "<p>");
HtmlText = HtmlText.Replace("\r", "<br>");
return HtmlText;
}
public static string ConvertHTMLtoText(string HtmlText)
{
HtmlText = HtmlText.Replace ("\r","\n");
HtmlText = HtmlText.Replace( "<p>","\r\r");
HtmlText = HtmlText.Replace( "<br>","\r");
HtmlText = HtmlText.Replace("\r", "\r\n");
return HtmlText;
}