Text style change on the text box

 Hi experts,

I'm try to create an email system, i'm having problem on the compose new email which allow user to change their text style while they press the button, i had been totally out of idea to do it.

So please give me any idea and suggestion how to do it... Thanks...

Below is the basic of my code:

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="NewPost.aspx.cs" Inherits="_NewPost" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Compose New Email</title>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table align=center width=700 height=500>
            <tr>
                <td>
                    Title :
                </td>
                <td>
                    <asp:TextBox ID="txtTitle" runat="server" Width="503px"></asp:TextBox>
                </td>
            </tr>
           
            <tr>
                <td colspan=2 bgcolor=PaleTurquoise style="height: 26px">
                    <span>
                        <asp:Button ID="btnBold" runat="server" Text="B" Width="34px" OnClick="btnBold_Click" />
                    </span>
                   
                    <span>
                        <asp:Button ID="btnItalic" runat="server" Text="I" Width="34px" OnClick="btnItalic_Click" />
                    </span>
                   
                    <span>
                        <asp:Button ID="btnAlignL" runat="server" Text="L" Width="34px" OnClick="btnAlignL_Click" />
                    </span>
                   
                    <span>
                        <asp:Button ID="btnAlignC" runat="server" Text="C" Width="34px" OnClick="btnAlignC_Click" />
                    </span>
                   
                    <span>
                        <asp:Button ID="btnAlignR" runat="server" Text="R" Width="34px" OnClick="btnAlignR_Click" />
                    </span>
                   
                    <span>
                        <asp:Button ID="btnAlignJ" runat="server" Text="J" Width="34px" OnClick="btnAlignJ_Click" />
                    </span>
                   
                    <span>
                        <asp:Button ID="btnUnderline" runat="server" Text="U" Width="34px" OnClick="btnUnderline_Click" />
                    </span>
                   
                    <span>
                        <asp:Button ID="btnOrder" runat="server" Text="Ord" Width="34px" OnClick="btnOrder_Click" />
                    </span>
                   
                    <span>
                        <asp:Button ID="btnUnorder" runat="server" Text="Uno" Width="34px" OnClick="btnUnorder_Click" />
                    </span>                   
                </td>
            </tr>
           
            <tr>
                <td colspan=2 align=center>
                    <asp:TextBox ID="txtNew" runat="server" Width="680" Height="370"></asp:TextBox>
                </td>
            </tr>
           
            <tr>
                <td>
                    Chapter :
                </td>
                <td>
                    <asp:DropDownList ID="ddlTags" runat="server" Width="517px">                  
                    </asp:DropDownList>
                </td>
            </tr>

            <tr>
                <td>
                    <asp:Button ID="btnPost" Text="Post" runat="server" OnClick="btnPost_Click" />
                </td>
               
                <td align=right>
                    <asp:Button ID="btnClear" Text="Clear" runat="server" OnClick="btnClear_Click" />
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>

----------

Mike

0
Steammike
3/24/2009 8:32:07 AM
asp.net.web-forms 93655 articles. 5 followers. Follow

2 Replies
769 Views

Similar Articles

[PageSpeed] 56

 Hi,

You cannot apply custom formatting within a normal textbox.

You need to use a Rich Text Editor such as:

0
rtpHarry
3/24/2009 9:30:29 AM

 Thanks...

I got it alreadyBig Smile

0
Steammike
3/25/2009 6:54:54 AM
Reply: