[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;
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
Re: [2005] Multiline with web
Thanks but how you do it using Response.Write();
Re: [2005] Multiline with web
Using Break-Line tag <br />
C# Code:
Response.Write("First Line<br />Second Line");
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 ?:blush:
Re: [RESOLVED] [2005] Multiline with web
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.