Link to home
Start Free TrialLog in
Avatar of Ken H.
Ken H.

asked on

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?
Avatar of Rajkumar Gs
Rajkumar Gs
Flag of India image

Please give this a try

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

Raj
Avatar of Ken H.
Ken H.

ASKER

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.
Avatar of Ken H.

ASKER

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
Avatar of Ken H.

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of Rajkumar Gs
Rajkumar Gs
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ken H.

ASKER

Please give credit to RajkumaGS. His solution is much more lightweight and is a better fit.
Avatar of Ken H.

ASKER

This works great. Thanks!
Thanks newimagent.

You can now accept my solution.

raj
Thanks for the points. and glad as I can help you :)
Raj