Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 23rd, 2004, 10:02 AM
Authorized User
 
Join Date: Apr 2004
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default preserving txt box format when INSERTing

Hi,

Im using C# and SQL Server. I'm trying to upload some text from a simple form and keep the formatting (ie: line breaks)

I have searched and search for this but cant find an answer anywhere. The only thing I can find is Replace(str,"\n","<br />")

but I specifically DONT want HTML in my database.

Does anyone have any ideas what I can replace the '<br />' with in the above statement? Thanks in advance,

Pete

 
Old December 2nd, 2004, 11:49 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You can store the data as-is in the database. But when you display the data in a webform as literal text, you'll ALWAYS have to change the hard returns with <br> otherwise it simply won't wrap.

Take a look at this very forum. This forum stores the text you enter in the textbox as-is in the database. You can verify this by simply editing an existing post. When the forum displays the message, it replaces the literal line breaks with HTML breaks so it displays correctly.





Similar Threads
Thread Thread Starter Forum Replies Last Post
export to txt format mallick_kuet Crystal Reports 0 January 21st, 2007 02:50 AM
export in txt format mallick_kuet C# 2005 0 January 20th, 2007 06:24 AM
export in txt format mallick_kuet BOOK: Professional Crystal Reports for VS.NET 0 January 20th, 2007 05:22 AM
export crystal report in txt format mallick_kuet Crystal Reports 0 January 20th, 2007 02:35 AM
save dataset in txt format??? thomaz C# 3 March 20th, 2006 01:29 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.