Groups | Blog | Home
all groups > inetserver asp general > september 2004 >

inetserver asp general : Inserts HTML line breaks before all newlines in a string



Chris Mach
9/30/2004 8:02:11 AM
Hey,

If i'am writing a post in a "textarea" and i use the ENTER (newline) on =
my keyboard it comes as a line break <br> in my post on the forum.

PHP uses "nl2br", but what is the ASP solution for this?=20


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Chris Mach
9/30/2004 8:46:00 AM

[quoted text, click to view]

Yes, that is what I want to do, how is that done?

please? :D


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.771 / Virus Database: 518 - Release Date: 28-Sep-2004

jeff.nospam NO[at]SPAM zina.com
9/30/2004 12:37:52 PM
On Thu, 30 Sep 2004 08:02:11 -0400, "Chris Mach" <cjmach@gto.net>
[quoted text, click to view]

Depends on wht you actually want, but this may be what the equivalent
to PHP would be:

strPost = Replace(FormInput,VbCrLf,"<br>")

FormInput is what comes from the text area, strPost is the post with
HTML breaks.

Personally, I store the text verbatim in the database and replace on
retrieving it, but it could work either way.

jeff.nospam NO[at]SPAM zina.com
9/30/2004 8:07:22 PM
On Thu, 30 Sep 2004 08:46:00 -0400, "Chris Mach" <cjmach@gto.net>
[quoted text, click to view]

Are you asking how to save a text input field to a database field,
retrieve the data from the database, format it for display or all of
the above?

Might look at:

http://www.1asphost.com/asp_db.asp

It's not perfect, but will get you started.

AddThis Social Bookmark Button