Wrox Programmer Forums
|
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 19th, 2003, 11:27 PM
Authorized User
 
Join Date: Nov 2003
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to save text with format??

hello everybody,
i am comfused by:
if i type the words below in a textbox:
"hello
world
by
6cet6"
then i would get them after a while,and display them in label
but what i could see is:
"hello world by 6cet6"
how could i do???


 
Old November 20th, 2003, 05:05 AM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to life_s Ng Send a message via MSN to life_s Ng
Default


... put the statement below in a subroutine, like a subroutine when u click on a button. or u can just use ur tbname to create an event.

lblname.Text= tbname.Text

im not sure is this what u want...

hope this help
Regards
life's Ng

 
Old November 20th, 2003, 05:50 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Are you roundtripping the data? That is, retrieve it from a <textarea> retrieve it on the server and then display it again?

In HTML a simple line feed / carriage return has no meaning. So, the "enter" you pressed in the textarea won't show up on the page (although it will in the source of the page).

Before you put the text from the textarea back in a label, use the Replace method of the string class to convert the line breaks to HTML breaks, like this:
Code:
string myText = TextBox1.Text.Replace("\r\n", "<br />");
Label1.Text = myText;
This will replace all line feed / carriage return combinations with the HTML counterpart, the
tag.

HtH,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old November 20th, 2003, 06:27 AM
Authorized User
 
Join Date: Nov 2003
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thank you ,i would try it now!

 
Old November 20th, 2003, 06:49 AM
Authorized User
 
Join Date: Nov 2003
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

it works well
thank you!!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert Rich Text Format to Ordinary Format in ASP Andraw Classic ASP Basics 1 August 31st, 2007 10:05 AM
save dataset in txt format??? thomaz C# 3 March 20th, 2006 01:29 PM
Save Datagrid in a Excell format thomaz C# 6 February 24th, 2006 12:53 AM
html page save to excel format mateenmohd Javascript 2 January 17th, 2004 05:48 AM
Save universal date format einarhansen Classic ASP Databases 2 November 26th, 2003 05:58 AM





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