Print the string in next line of MultiLine TextBox [Resolved]

Posted by Sathya4260 under ASP.NET on 3/4/2011 | Points: 10 | Views : 6611 | Status : [Member] | Replies : 4
Hi,

I am having an textbox with textmode as multiline and now i have to pass two strings to the textbox,

Ist string value in first line and
2nd string values in second line

I have tried as

textbox.text=string1+"<br/>"+string2;

But this is not working,Kindly let me now how to do...

Thanks in advance

Sathish Kumar S


Responses

Posted by: Sathya4260 on: 3/4/2011 [Member] Starter | Points: 25

Up
0
Down

Resolved
I found the answer, this works for me,

textbox.text = string1 + "\r\n" + string2;

Sathish Kumar S

Sathya4260, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Madhu.b.rokkam on: 3/4/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
textBox.Text = "Madhu" + Environment.NewLine + "Rokkam";

This is C# way of doing this

Thanks and Regards
Madhu

Sathya4260, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gsolvers on: 3/7/2011 [Member] Starter | Points: 25

Up
0
Down
Guys,
A bit on performance.
It is better to use String.Concat instead of "+" to join to strings. This has positive impact on performance and is recommended by microsoft.



Best Regards,

VG
www.TeacherJi.com

Sathya4260, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 3/7/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Accepted with Gsolvers!!! good one!!!

Thanks
Karthik
www.f5Debug.net

Sathya4260, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response