locked
Inserting a Pre-formated text into database using ado.net RRS feed

  • Question

  • User-913695833 posted

    please how can i insert a message into the database and display it exactly as the user type it into the multiline textbox i.e if the user add breakline or many space i want it to be inserted into the databse like that and also when databinding it back to the User interface it should appear exactly as it was input into the database. Thanks

    Monday, December 2, 2013 8:28 PM

Answers

  • User697462465 posted

    Hi dbayo,

    The textbox can't to save exactly format string to database.

    So, I suggest you using the html editor tool, like the kind editor, it will meet your requirements.

    About the Kind Editor, you can search in bing and download it.

    Hope it can help you.

    Best Regards,
    Terry Guo

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, December 4, 2013 2:56 AM

All replies

  • User323983933 posted

    The problem might be when you're trying to show the results back on the web page.  HTML standards ignore whitespace so this...

    Hello

    Sweety.

    ...will render as

    Hello Sweety.

    I would start with wrapping the display of the text your user input with <pre></pre> tags.  This should display exactly what they typed, unless they typed in HTML or Javascript.  So if they typed

    Hello <i>Sweety</i>.

    Using <pre> will show it as

    Hello Sweety.

    not

    Hello <i>Sweety</i>.

    Tell me if this helps

    Tuesday, December 3, 2013 3:46 PM
  • User697462465 posted

    Hi dbayo,

    The textbox can't to save exactly format string to database.

    So, I suggest you using the html editor tool, like the kind editor, it will meet your requirements.

    About the Kind Editor, you can search in bing and download it.

    Hope it can help you.

    Best Regards,
    Terry Guo

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, December 4, 2013 2:56 AM