473,399 Members | 3,888 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,399 software developers and data experts.

plain text with html as output

Could someone provide a code in asp that converts string input to html source code? Thanks in advance ^_^
Sep 27 '07 #1
5 1682
Could someone provide a code in asp that converts string input to html source code? Thanks in advance ^_^
Hi,memermore
Please make clear what actually you want.
Thanks.
Sep 27 '07 #2
oops...sorry. What I mean is a code that will attach HTML tags on a plain text specifically from a <textarea>. I do hope I stated it right this time. ^^
Sep 28 '07 #3
oops...sorry. What I mean is a code that will attach HTML tags on a plain text specifically from a <textarea>. I do hope I stated it right this time. ^^
Hi, memermore
Do you mean displaying text in html format like:
<textarea> to be displayed on the page, then you can use html entities for the angle brackets insine the 'response.write( )' method.
Html entities are used to diplay special characters in an html page.
For more details please search in the web.

If It is not what you want then just inform where I was wrong.

---------------------------
Thanks & Regards
Sep 28 '07 #4
jhardman
3,406 Expert 2GB
oops...sorry. What I mean is a code that will attach HTML tags on a plain text specifically from a <textarea>. I do hope I stated it right this time. ^^
If I understand right, you are saying that the user will input plain text into a text area, and you want to know the best way to display it with HTML formatting. Is this right? Usually there isn't a lot of formatting required, you might want to change special characters to character codes, and add paragraph tags or line breaks to maintain white space. Does this sound like what you want? Basically you would put the input through a series of replace statements that replace the given input with what output you want, like this:
Expand|Select|Wrap|Line Numbers
  1. dim txt
  2. txt = request.form("myTextBox1")
  3. txt = replace(txt, "&", "&amp;")
  4. txt = replace(txt, chr(34), "&amp;quot;")
  5. txt = replace(txt, vbNewLine, "<br>"&vbNewLine)
  6. response.write txt
You might want to look into "server.htmlencode" which is a function that does some of this (if I remember right it replaces the special characters), and depending on your needs, you might be able to use <pre> text input goes here </pre> tags.

Let me know if this helps.

Jared
Sep 28 '07 #5
I am now filling my code with those replace() statements. Thanks guys!
Oct 1 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: J. Alan Rueckgauer | last post by:
Hello. I'm looking for a simple way to do the following: We have a database that serves-up content to a website. Some of those items are events, some are news articles. They're stored in the...
3
by: pradeep gummi | last post by:
I have an XML FILE that is to be converted to Plain Text using an XSL file. Since I just want plain text, I do not want to set any root element during transformation.And if I do not any root...
14
by: Akseli Mäki | last post by:
Hi, Hopefully this is not too much offtopic. I'm working on a FAQ. I want to make two versions of it, plain text and HTML. I'm looking for a tool that will make a plain text doc out of the...
8
by: LRW | last post by:
I'm not sure this message is totally appropriate for this group, so please, if anyone has a better group suggestion, let me know! My company sends out a monthly newsletter in HTML format to our...
6
by: Big D | last post by:
I have a simple xml file that contains, in part, content that is in HTML. I am encompassing that content in <!]> tags. This works fine. However, my application needs to output the XML file...
2
by: Mike Bridge | last post by:
Is there any way to get Internet explorer to treat a text/plain .net page as plain text using asp.net? It seems like IE doesn't trust text/plain as a mime type, and so it (ironically) displays it...
8
by: Doominato | last post by:
good day, I was just wondering how can I download a web page as plain text from a certain web site. I have tried to use the OpenURL() method from INET control in my VB.NET app, but it returns...
10
by: Eric Lindsay | last post by:
This may be too far off topic, however I was looking at this page http://www.hixie.ch/advocacy/xhtml about XHTML problems by Ian Hickson. It is served as text/plain, according to Firefox...
3
by: realmerl | last post by:
Hi All. I'm trying to transform a html document into plain text via xslt. Simple you say! (i hope) I have got it working, by using the magnificent <xsl:value-of select="."/>. This returns the...
2
by: Ambika1 | last post by:
I need to convert HTMl into plain text output in vb.net. Can anyone please tell me how can I transform HTML into plain text with an example. Thanks
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.