-1

I am working on a web development project where I want add details for particular foods. So I added a multiline textbox where I want to type the details. I wanted to save that details into database and later wanted to use those text in another page reading from the database. But when I am showing those text into another webpage all the text are showing into single line. What should I do to resolve this problem?

5
  • Why are you using a multiline textbox? Commented Mar 17, 2015 at 12:47
  • 3
    @Vajura: Why do you care? Commented Mar 17, 2015 at 12:48
  • Carriage returns don't render on a web page. When you display the text you need to replace carriage returns with "br" tags. Commented Mar 17, 2015 at 12:48
  • You can check this:- stackoverflow.com/questions/4883613/… Commented Mar 17, 2015 at 12:50
  • Thanks, i got the answer now. @Rahul Commented Mar 17, 2015 at 12:59

2 Answers 2

1

Try showing the \n (new line) this way:

text.Replace("\n","<br/>")
Sign up to request clarification or add additional context in comments.

Comments

0

Use textarea instead of textbox and then get data using getInnerHTML this helps to save formatted data

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.