473,769 Members | 3,893 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.BodyPart s.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 2532
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(Contr olChars.vbCr, "
").Replace(Cont rolChars.vbLf, " ")

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

--
John Saunders
Internet Engineer
jo***********@s urfcontrol.com
"kennethfin e" <ke*********@ho tmail.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.BodyPart s.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
8065
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 expected with alphabet and number characters and the ' (single quote &apos; entity) character but does not work if a double quote character " is part of the string to filter on This returns all Vendor Names that begin with A (either case)
3
11699
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. For example: - Strip(Char(Digits(v_cntrct_no_seed)),L,'0') - v_cntrct_no_seed is defined as Integer - Char and Digits return a character representation of a number with
5
3446
by: Steven | last post by:
Can anyone tell me how to toggle the "Caps Lock" key? Thanks in advance
28
2949
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! PEP: 359 Title: The "make" Statement Version: $Revision: 45366 $ Last-Modified: $Date: 2006-04-13 07:36:24 -0600 (Thu, 13 Apr 2006) $
14
5935
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 because of this, so I hope some of you gurus can enlighten me with this :) In what circumstances can the "&amp;" in the source code be involuntary changed to "&" by a browser when or other software, when editing and uploading the file to the web...
8
3619
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 <br>mais pour avoir des resultats probant il faut pas faire les mariolles, comme le &quot;fondateur&quot; de bvs
3
9282
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 you do something like this: http.onreadystatechange = myAwesomeFunction;
12
2379
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
5333
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 me to translate this: #include <windows.h> // szDeviceName ->Device Driver Name
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10211
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10045
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9994
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8870
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3958
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.