Results 1 to 7 of 7

Thread: [RESOLVED] [2005] Multiline with web

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2006
    Posts
    275

    Resolved [RESOLVED] [2005] Multiline with web

    Hi

    I want to use multiline with web forms,
    If I use this:

    for (int a = 0; a < 10; a++)
    Response.Write("Abbas Haider" + Environment.NewLine);
    or

    for (int a = 0; a < 10; a++)
    Response.Write("Abbas Haider" + "\n");

    It does not print the text in newline.

    Also the textbox does not support multiline property like in windows forms.
    So I can write:


    for (int a = 0; a < 10; a++)
    TextBox1.Text =TextBox1.Text + "Abbas Haider" + Environment.NewLine;

  2. #2
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: [2005] Multiline with web

    This worked for me

    Code:
     TextBox2.TextMode = TextBoxMode.MultiLine
            TextBox2.Text += "Line1" + Environment.NewLine
            TextBox2.Text += "Line2" + Environment.NewLine
            TextBox2.Text += "Line3" + Environment.NewLine
    Please mark you thread resolved using the Thread Tools as shown

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2006
    Posts
    275

    Re: [2005] Multiline with web

    Thanks but how you do it using Response.Write();

  4. #4
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: [2005] Multiline with web

    Using Break-Line tag <br />
    C# Code:
    1. Response.Write("First Line<br />Second Line");
    Show Appreciation. Rate Posts.

  5. #5
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: [2005] Multiline with web

    Quote Originally Posted by Abbas Haider
    Thanks but how you do it using Response.Write();
    What you are going to write ?
    Please mark you thread resolved using the Thread Tools as shown

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2006
    Posts
    275

    Re: [RESOLVED] [2005] Multiline with web

    Thanks both of you

  7. #7
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [RESOLVED] [2005] Multiline with web

    Response.Write writes to the page. (And you shouldn't be using it) That means you need to use a <br />

    When writing to a textbox, then you should use System.Environment.NewLine.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width