Combine the text from multiple text boxes into one text box and inject html formatting

Exactly as the title states. Below is a failed example from that you should understand what I am trying to do.

txtBox3.text = txtBox1.text & <br></br> & txtBox2.text

How can I make this scenario work?
LVL 1
newimagentAsked:
Who is Participating?
 
Rajkumar GsSoftware EngineerCommented:
Also if you enable TextMode="MultiLine" and use this code, it should work
txtBox3 = txtBox1.Text & vbCrLf  & txtBox2.Text

Raj
0
 
Rajkumar GsSoftware EngineerCommented:
Please give this a try

txtBox3.text = txtBox1.text & "<br /><br />" & txtBox2.text

Raj
0
 
newimagentAuthor Commented:
That does not work. I've tried that as well.

I've also tried

Dim br As New HtmlGenericControl("br")
txtBox3.text = txtBox1.text & br & txtBox2.text

Anything in double quotes just shows up as text in the box and does not inject as html formatting.
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
newimagentAuthor Commented:
I managed to figure it out. Not sure if this is how you're supposed to do it but it works and the back and change view state functions are not giving me any kind of cross scripting error so i'll go with it.

Solution:

Dim br As New HtmlGenericControl(<br/>)

txtBox3 = txtBox1.Text & br.InnerHtml & txtBox2.Text
0
 
newimagentAuthor Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for newimagent's comment http:/Q_27398213.html#36972592

for the following reason:

Figured it out.
0
 
newimagentAuthor Commented:
Please give credit to RajkumaGS. His solution is much more lightweight and is a better fit.
0
 
newimagentAuthor Commented:
This works great. Thanks!
0
 
Rajkumar GsSoftware EngineerCommented:
Thanks newimagent.

You can now accept my solution.

raj
0
 
Rajkumar GsSoftware EngineerCommented:
Thanks for the points. and glad as I can help you :)
Raj
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.