Click here to Skip to main content
15,910,603 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to add html tag to label or textbox.

for eg.

txtbody.Text="<html><body>

HI..


How are you?

</body></html>";

i want this.

So please tell me how to do this?

It's urgent. Please.

Server.HtmlEncode is working for label but when i assign label to textbox it's not working.
Posted
Updated 13-Nov-14 22:23pm
v3
Comments
Mukesh Ghosh 14-Nov-14 1:15am    
What problem are you facing? Have you tried multiline for TextBox?
Member 8469338 14-Nov-14 3:39am    
I working on email application. I want formatted output in the textbox (body textbox). Means

Sir,

thank you for visiting.

From

ABC
Sinisa Hajnal 14-Nov-14 2:25am    
What have you tried? Also, consider that things that are urgent to you aren't at all urgent to other people. We do our best here, but putting pressure on anyone isn't likely to help.
Member 8469338 14-Nov-14 3:40am    
Sorry. But i am not putting pressure on any one.
I working on email application. I want formatted output in the textbox (body textbox). Means

Sir,

thank you for visiting.

From

ABC

Please check this link

http://forums.asp.net/t/1576091.aspx?Fill+Label+with+HTML+Tags[^]

Hope it will help..
 
Share this answer
 
You could use HTML Editor control[^].

The link above is for AjaxToolkit, but there are others with more or less functionality and complexity.

If this helps please take time to accept the solution. Thank you.
 
Share this answer
 
Hi,

Use \n instead of html.

C#
TextBox1.Text = "HI..\nHow are you?";


And For Your Information Use Multiline Textbox.
 
Share this answer
 
Comments
Member 8469338 17-Nov-14 1:25am    
if i want to bold letters then how can i do it?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900