Topbar
Topbar
Sign in
|
Join
|
Client Center
Home
Products
Client Center
Contact
Purchase
Support forums
»
Products
»
Cute Editor for .NET
»
Need help with plain text
Need help with plain text
Last post 04-07-2006, 4:39 PM by
mhunter
. 3 replies.
Sort Posts:
Oldest to newest
Newest to oldest
Previous
Next
04-07-2006, 4:10 PM
18001
mhunter
Joined on 07-03-2005
Posts 6
Need help with plain text
Reply
Quote
I am using the editor for the creation of a web based mail system. When I set the plain text of my message to Editor1.PlainTextwithLineFeeds the text that comes through and is inserted into the message still is HTML encoded. Any suggestions?
Thanks again.
Mark
04-07-2006, 4:17 PM
18003
in reply to
18001
tekrat
Joined on 11-03-2005
Posts 20
Re: Need help with plain text
Reply
Quote
Maybe this ASP function to strip HTML code would work. It shouldn't be hard to convert:
' Function Strip All HTML Tags
' Author Abd Shomad:
' http://www.4guysfromrolla.com/webtech/abdshomad.shtml
Function StripHTMLTag(ByVal sText)
StripHTMLTag = ""
fFound = False
Do While InStr(sText, "<")
fFound = True
StripHTMLTag = StripHTMLTag & " " & Left(sText, InStr(sText, "<")-1)
sText = MID(sText, InStr(sText, ">") + 1)
Loop
StripHTMLTag = StripHTMLTag & sText
If Not fFound Then StripHTMLTag = sText
End Function
http://www.4guysfromrolla.com/webtech/100199-1.shtml
04-07-2006, 4:29 PM
18004
in reply to
18003
mhunter
Joined on 07-03-2005
Posts 6
Re: Need help with plain text
Reply
Quote
From your reply, I am guessing that this is not an inherent function of the editor. If that is the case, I will have to implement some type of script, such as the one you have suggested. Know of any versions in c#?
Thanks again.
Mark
04-07-2006, 4:39 PM
18006
in reply to
18004
mhunter
Joined on 07-03-2005
Posts 6
Re: Need help with plain text
Reply
Quote
Looks like I found the solution in c# as the following:
string
plainbody = Editor1.PlainTextWithLinefeeds + endtagtxt;
string
stripped = Regex.Replace(plainbody,
@"<(.|\n)*?>"
,
string
.Empty);
msg.PlainMessage.Body = stripped;