What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 5895 |  Welcome, Guest!   Register  Login
 Home > Forums > ASP.NET > Print the string in next line of MultiLine TextBox ...
Sathya4260

Print the string in next line of MultiLine TextBox

Replies: 4 | Posted by: Sathya4260 on 3/4/2011 | Category: ASP.NET Forums | Views: 3446 | Status: [Member] | Points: 10  


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


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Sathya4260
Sathya4260  
Posted on: 3/4/2011 7:47:08 AM
Level: Starter | Status: [Member] | Points: 25

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. | Reply | Alert Moderator 

Madhu.b.rokkam
Madhu.b.rokkam  
Posted on: 3/4/2011 1:02:25 PM
Level: Bronze | Status: [Member] [MVP] | Points: 25

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. | Reply | Alert Moderator 

Gsolvers
Gsolvers  
Posted on: 3/7/2011 1:07:49 AM
Level: Starter | Status: [Member] | Points: 25

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. | Reply | Alert Moderator 

Karthikanbarasan
Karthikanbarasan  
Posted on: 3/7/2011 2:51:18 AM
Level: Silver | Status: [Member] [Moderator] [Microsoft_MVP] [MVP] | Points: 25

Accepted with Gsolvers!!! good one!!!

Thanks
Karthik
www.f5Debug.net

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

Reply - Please login to reply


Click here to login & reply

Found interesting? Add this to:


 Latest Posts

Write New Post | More ...

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/26/2013 3:23:28 AM