Multi-line formatting on an ASP page

  • Thread starter Thread starter Graham Taylor
  • Start date Start date
G

Graham Taylor

I have a database which has a text field in it listing words on separate
lines (by pressing Ctrl+Enter after each word). When I display the field on
an ASP page the formatting is lost and the words all appear on a single line
which wraps around in the box.

Is there a way of preserving the Ctrl+Enter so that the words still appear
on separate lines?

Thanks,
Graham
 
Use a custom query that threats the field as follows:

SELECT Replace([textfield],chr(13),'<br>') as textfieldhtml, ...

then report the textfieldhtml field rather than textfield.

Also, after the DRW completes, right-click <<textfieldhtml>> in the Database
Results Region, choose Database Column Value Properties, select Column Value
Contains HTML, and click OK.

Jim Buyens
Microsoft MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Windows SharePoint Services Inside Out
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 
Thanks for that - works a treat!

Graham

Jim Buyens said:
Use a custom query that threats the field as follows:

SELECT Replace([textfield],chr(13),'<br>') as textfieldhtml, ...

then report the textfieldhtml field rather than textfield.

Also, after the DRW completes, right-click <<textfieldhtml>> in the
Database
Results Region, choose Database Column Value Properties, select Column
Value
Contains HTML, and click OK.

Jim Buyens
Microsoft MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Windows SharePoint Services Inside Out
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------


Graham Taylor said:
I have a database which has a text field in it listing words on separate
lines (by pressing Ctrl+Enter after each word). When I display the field
on
an ASP page the formatting is lost and the words all appear on a single
line
which wraps around in the box.

Is there a way of preserving the Ctrl+Enter so that the words still
appear
on separate lines?

Thanks,
Graham
 
Back
Top