tags:

views:

120

answers:

4

i need to concatenate the html tag like <br/> and &nbsp; to the textbox.text in asp.net textbox

i have used this txtMessage.Text + <br/> + strgetlist;

but it is displaying

TaskName<br/>Project1,project2..

how to give break and space between thest two.

Any idea????

A: 

Try using txtMessage.Text + "<br/>" + strgetlist

Pandiya Chendur
ya i have used this oly ,bt im getting <br/> printed out
Ranjana
ASP.Net will htmlEncode its Text for output.
David
A: 

You can use Environment.NewLine as long as you have set TextMode="MultiLine" for the TextBox. Just a plain space (i.e. " ") should work to get a space in the 'list'.

Is that what you meant?

David
A: 

you could try using string.Format

string.Format("{0}<br />{1}", txtMessage.Text, strgetlist);

garpunkal
A: 

Here i am assuming that the output is to be shown in a textbox. First make the textbox TEXTMODE as multiline. Then on the textbox where u have to show the output (say txtOutput)

here u write:

txtOutput = TextBox1.Text + "\n" + strgetlist;
HotTester