473,320 Members | 1,987 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Creating a "translate" function in ASP.NET, streaming in HTML from the web?

I'm transitioning from ASP development, please excuse
these basic questions. One thing I did often in ASP was
create a "translate" function to render one string to
another, strip out excess carriage returns, etc.

I want to do the same thing in ASP.NET. I have a mail
component that will accept HTML, but it requires all HTML
to be listed on a single line. It takes the syntax:

msgObj.BodyParts.Add(" <html markup here> "),
BodyPartFormat.HTML)

Can someone point me to how I might translate a string
with carriage returns/newlines into a single unbroken
line? How about if I wanted to translate one character to
another?

Best would be if ASP.NET would actually visit a live page
on the web, strip out the HTML it needs, and embed it in
the string above as a single line.

Thanks in advance for any pointers or resources you might
be able to provide.

-KF
Nov 17 '05 #1
1 2512
I bet your mail component will accept a variable which contains carriage
returns.

But you should look at the methods of the System.String class. In
particular,

Dim x as String = "something with CR and/or LF in it"
Dim stripped as String = x.Replace(ControlChars.vbCr, "
").Replace(ControlChars.vbLf, " ")

Note I'm replacing with a space, so that "A<CrLf>B" doesn't become "AB".

--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"kennethfine" <ke*********@hotmail.com> wrote in message
news:06****************************@phx.gbl...
I'm transitioning from ASP development, please excuse
these basic questions. One thing I did often in ASP was
create a "translate" function to render one string to
another, strip out excess carriage returns, etc.

I want to do the same thing in ASP.NET. I have a mail
component that will accept HTML, but it requires all HTML
to be listed on a single line. It takes the syntax:

msgObj.BodyParts.Add(" <html markup here> "),
BodyPartFormat.HTML)

Can someone point me to how I might translate a string
with carriage returns/newlines into a single unbroken
line? How about if I wanted to translate one character to
another?

Best would be if ASP.NET would actually visit a live page
on the web, strip out the HTML it needs, and embed it in
the string above as a single line.

Thanks in advance for any pointers or resources you might
be able to provide.

-KF

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David Furey | last post by:
Hi I have an XML documnet and a XSLT document as shown below THe XSLT document brings back a filtered docmument that has the VendorName that starts with a particular sub-string This works as...
3
by: alex.mcshane | last post by:
Hi - I would be grateful for any advice on the following. Within DB2 for OS/390, the STRIP Scaler Function is available. Its function is, for example, to remove leading zeros from a string. ...
5
by: Steven | last post by:
Can anyone tell me how to toggle the "Caps Lock" key? Thanks in advance
28
by: Steven Bethard | last post by:
Ok, I finally have a PEP number. Here's the most updated version of the "make" statement PEP. I'll be posting it shortly to python-dev. Thanks again for the previous discussion and suggestions!...
14
by: Arne | last post by:
A lot of Firefox users I know, says they have problems with validation where the ampersand sign has to be written as &amp; to be valid. I don't have Firefox my self and don't wont to install it only...
8
by: Ulysse | last post by:
Hello, I need to clean the string like this : string = """ bonne mentalit&eacute; mec!:) \n <br>bon pour info moi je suis un serial posteur arceleur dictateur ^^* \n ...
3
pbmods
by: pbmods | last post by:
AN INTRODUCTION TO FUNCTION OBJECTS LEVEL: INTERMEDIATE PREREQS: OBJECTS You've seen it before. You're setting up an XMLHttpRequest call, and you need to execute a function when it returns, so...
12
by: Jon Slaughter | last post by:
is there any way to simply add an attribute like feature to a function/method definition? say I create a function like function Test() { //.... }
2
by: Peter | last post by:
Hi I write a POS (point-of-sale) applic. until now i use c# code to open the cash-drawer. But now there is a new hardware and i have just a c++ code snip to do this. Please can somebody help...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.