Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Formatting Memo Lines For HTML output
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01000254
Message ID:
01000514
Vues:
31
>All works except the formatting is lost for the memos. In a Web Connection VFP app in the past, I have had to replace (using STRTRAN()) all CRLFs with < br > (without the spaces) prior to rendering them.


>
>What is the equivalent in C#? (I am guessing this may involve StringBuilder, but I have no idea of the syntax, or how you represent CHR(13)+CHR(10) in .NET)

You still have to do this manually. I have - not surprisingly - wwUtils.DisplayMemo():
/// <summary>
/// Fixes a plain text field for display as HTML by replacing carriage returns 
/// with the appropriate br and p tags for breaks.
/// </summary>
/// <param name="String Text">Input string</param>
/// <returns>Fixed up string</returns>
public static string DisplayMemo(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;
}
>
>TIA, Kevin
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform