Keep the format of MultiLine TextBox.Text

Discussion in 'ASP .Net' started by =?Utf-8?B?ZnJhbms=?=, Aug 16, 2006.

  1. please help!

    How to keep the format of the content of a MultiLine TextBox. For example,
    'new line'

    I try the code:
    ------------------------------
    TextBox.Text = "TERANET / MPAC - KEY TERMS OF USE \n" & _
    "3.1 \n" & _
    .......
    ------------------------------

    The display in Browser is:
    ------------------------------
    TERANET / MPAC - KEY TERMS OF USE \n3.1\n ...
    ------------------------------

    Thanks a lot!
     
    =?Utf-8?B?ZnJhbms=?=, Aug 16, 2006
    #1
    1. Advertising

  2. The browser ignores extra whitespace. If you try to put 3 spaces in a row,
    it will only show you one.
    Try using <br> for a newline.

    "frank" <> wrote in message
    news:...
    > please help!
    >
    > How to keep the format of the content of a MultiLine TextBox. For example,
    > 'new line'
    >
    > I try the code:
    > ------------------------------
    > TextBox.Text = "TERANET / MPAC - KEY TERMS OF USE \n" & _
    > "3.1 \n" & _
    > ......
    > ------------------------------
    >
    > The display in Browser is:
    > ------------------------------
    > TERANET / MPAC - KEY TERMS OF USE \n3.1\n ...
    > ------------------------------
    >
    > Thanks a lot!
    >
     
    Marina Levit [MVP], Aug 16, 2006
    #2
    1. Advertising

  3. Oh hold on, you are talking about a textbox here. Sorry, I thought you just
    had text right in the HTML.

    Try using System.Environment.Newline instead of '\n'.

    "frank" <> wrote in message
    news:...
    > please help!
    >
    > How to keep the format of the content of a MultiLine TextBox. For example,
    > 'new line'
    >
    > I try the code:
    > ------------------------------
    > TextBox.Text = "TERANET / MPAC - KEY TERMS OF USE \n" & _
    > "3.1 \n" & _
    > ......
    > ------------------------------
    >
    > The display in Browser is:
    > ------------------------------
    > TERANET / MPAC - KEY TERMS OF USE \n3.1\n ...
    > ------------------------------
    >
    > Thanks a lot!
    >
     
    Marina Levit [MVP], Aug 16, 2006
    #3
  4. I really appreciate it! It works very well.

    Frank

    "Marina Levit [MVP]" wrote:

    > Oh hold on, you are talking about a textbox here. Sorry, I thought you just
    > had text right in the HTML.
    >
    > Try using System.Environment.Newline instead of '\n'.
    >
    > "frank" <> wrote in message
    > news:...
    > > please help!
    > >
    > > How to keep the format of the content of a MultiLine TextBox. For example,
    > > 'new line'
    > >
    > > I try the code:
    > > ------------------------------
    > > TextBox.Text = "TERANET / MPAC - KEY TERMS OF USE \n" & _
    > > "3.1 \n" & _
    > > ......
    > > ------------------------------
    > >
    > > The display in Browser is:
    > > ------------------------------
    > > TERANET / MPAC - KEY TERMS OF USE \n3.1\n ...
    > > ------------------------------
    > >
    > > Thanks a lot!
    > >

    >
    >
    >
     
    =?Utf-8?B?ZnJhbms=?=, Aug 16, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Simon Middlemiss
    Replies:
    2
    Views:
    5,261
    Jacob Yang [MSFT]
    Nov 10, 2003
  2. Nathan Sokalski

    Placing control tag text in a multiline TextBox

    Nathan Sokalski, Jan 3, 2008, in forum: ASP .Net
    Replies:
    2
    Views:
    520
    Nathan Sokalski
    Jan 3, 2008
  3. frank

    Keep the format of MultiLine TextBox.Text

    frank, Aug 15, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    146
    frank
    Aug 15, 2006
  4. Nathan Sokalski

    Placing control tag text in a multiline TextBox

    Nathan Sokalski, Jan 3, 2008, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    221
    Nathan Sokalski
    Jan 3, 2008
  5. dale zhang
    Replies:
    8
    Views:
    450
    Tintin
    Nov 30, 2004
Loading...

Share This Page