Remya
Remya

Reputation: 103

HTML Format in .Net TextBox

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

Upvotes: 1

Views: 3373

Answers (4)

Pooterdoop
Pooterdoop

Reputation: 1

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.

Upvotes: 0

Bert
Bert

Reputation: 1

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

Upvotes: 0

Zann Anderson
Zann Anderson

Reputation: 4897

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.

Upvotes: 1

Pranay Rana
Pranay Rana

Reputation: 176896

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.

Upvotes: 2

Related Questions