|
-
Sep 22nd, 2008, 07:05 AM
#1
Thread Starter
Hyperactive Member
[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;
-
Sep 22nd, 2008, 07:30 AM
#2
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
-
Sep 23rd, 2008, 02:09 AM
#3
Thread Starter
Hyperactive Member
Re: [2005] Multiline with web
Thanks but how you do it using Response.Write();
-
Sep 23rd, 2008, 03:51 AM
#4
Re: [2005] Multiline with web
Using Break-Line tag <br />
C# Code:
Response.Write("First Line<br />Second Line");
-
Sep 23rd, 2008, 04:23 AM
#5
Re: [2005] Multiline with web
 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
-
Sep 23rd, 2008, 09:53 PM
#6
Thread Starter
Hyperactive Member
Re: [RESOLVED] [2005] Multiline with web
-
Sep 24th, 2008, 05:25 AM
#7
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|