views:

263

answers:

2

I want to format lines of text differently in a .net C# webforms text box, eg. some lines italic or different colour? I know I can in windows forms, is there a richtextbox alternative for webforms? I find a lot of people asking but no answer...please can you help?

A: 

You can have the following properties

can set these inside your style tag

color: #ffffed

gives the text text inside a color

font-style: italic

will make the font in italics

<style>
   .styledText { color: #ffeded; font-style: italic; }
</style>
<input type="text" id="txt1" class="styledText" />

If you are using an asp.net textbox then you can use the cssclass property instead of the class property.

rahul
A: 

If you want colours, italic and bold all on the one control - then you want a rich HTML edit control. Have a look at FCKeditor and TinyMCE

russau