1

How I can display HTML formatted text in .Net TextBox?

4 Answers 4

2

Not possible

check this : http://www.freetextbox.com/

or

http://www.codeproject.com/KB/aspnet/RichTextBox.aspx

But you can go for the HTML editors like fck editor to do so.

Sign up to request clarification or add additional context in comments.

Comments

1

You might also look into extending the TextBox control to allow HTML syntax formatting and highlighting. I don't know how difficult or easy this might be, but it would certainly be an interesting learning experience. If you're not looking to "roll your own" then probably one of @Pranay's suggestions is your best bet.

Comments

0

If you dont have to EDIT the displayed formatted text, its easy use a literal control, but if you have to be able to change the info, you would need a control that can handle html.

I use FreeTextBox, but there are many.
Be aware of the dangers of allowing HTML to be edited in your page.... this is a weakspot that hackers love...
(you have to set validaterequest=false in each page that contains a HTML edit control Bert

Comments

0

It you're in ASP, use a literal control. If you're creating an application you can use a WebBrowser control. Looks the same as a large textbox, but can accept html formatting.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.