0

My ticketing system has a textbox for users to enter text and create/reply to a ticket. Currently when they enter multiple lines of text, once submitted, it will display as one line instead of two lines. We are storing all of the data in sql database and when displaying the responses they are showing as one line.

How can I get the value submitted to store in the database with multiline and then display back on the page with multiline when it pulls it from the database.

Thanks!

Visual Vincent
  • 18,045
  • 5
  • 28
  • 75
yDivide
  • 13
  • 3
  • 1
    Set `TextMode` to `MultiLine` – Xaqron Mar 11 '17 at 23:14
  • @Xaqron the textbox is already set to MultiLine. This gives the user the ability to enter multiple lines into the textbox, but once they hit submit, it displays as a single line on the page. – yDivide Mar 11 '17 at 23:17
  • If you pull data from db then this has nothing to do with round trip and you should check the path from db to UI. – Xaqron Mar 11 '17 at 23:19
  • check [this one out](http://stackoverflow.com/a/37356158/5176727), you can also check if /r/n exist on the db retrieve value. – jbalintac Mar 12 '17 at 00:39
  • 1
    can i know the datatype of sql column you are inserting the value into, i have set the datatype to nvarchar(max) and it works fine for mee – 5413 Mar 14 '17 at 16:27

1 Answers1

0

When reading the string from the database in the code behind, I had to use String.Replace(Environment.NewLine, "<br>")

yDivide
  • 13
  • 3
  • Please have a look at [Can I answer my own question?](http://stackoverflow.com/help/self-answer) and come back two days later and check as answered. – help-info.de May 04 '17 at 18:41