Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Formatting or Encoding a multiline textbox?

Formatting or Encoding a multiline textbox?

Scheduled Pinned Locked Moved ASP.NET
question
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dazinith
    wrote on last edited by
    #1

    If a user enters data into a multiline textbox (like the one im typing in now) how can i store the line breaks? in other words, if i just use myTextBox.Text it is all one long runon, even if i have a few blank lines like this: i am storing this textbox, then displaying it.. i want the line breaks to exist as they did when the user entered the text.. not a long runon.. do you know what i mean? is it something simple? thanks for the tips. still a newb.. cut me some slack :P -dz

    M 1 Reply Last reply
    0
    • D dazinith

      If a user enters data into a multiline textbox (like the one im typing in now) how can i store the line breaks? in other words, if i just use myTextBox.Text it is all one long runon, even if i have a few blank lines like this: i am storing this textbox, then displaying it.. i want the line breaks to exist as they did when the user entered the text.. not a long runon.. do you know what i mean? is it something simple? thanks for the tips. still a newb.. cut me some slack :P -dz

      M Offline
      M Offline
      Meysam Mahfouzi
      wrote on last edited by
      #2

      I have the same problem!:(


      Don't forget, that's

      Persian Gulf

      not Arabian gulf!

      D 1 Reply Last reply
      0
      • M Meysam Mahfouzi

        I have the same problem!:(


        Don't forget, that's

        Persian Gulf

        not Arabian gulf!

        D Offline
        D Offline
        dazinith
        wrote on last edited by
        #3

        i figured out a way to do it.. not sure if its the right way, but it seems to work for what i need it for..

        string strTemp = myTextBox.Text;
        string strCorrect = strTemp.Replace("\n", "<br>");

        that will make it go through the text and replace all the end of line characters with <br> hope that helps! still a newb.. cut me some slack :P -dz

        M 1 Reply Last reply
        0
        • D dazinith

          i figured out a way to do it.. not sure if its the right way, but it seems to work for what i need it for..

          string strTemp = myTextBox.Text;
          string strCorrect = strTemp.Replace("\n", "<br>");

          that will make it go through the text and replace all the end of line characters with <br> hope that helps! still a newb.. cut me some slack :P -dz

          M Offline
          M Offline
          Meysam Mahfouzi
          wrote on last edited by
          #4

          Yes, it works, no slack! ;) thank you! :):rose::)


          Don't forget, that's

          Persian Gulf

          not Arabian gulf!

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups