Click here to Skip to main content
15,936,602 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i'm trying to wrap a textbox but i'm getting that word-wrap is not a know css property name

well in fact it's working for a simple textbox but for a textbox in a gridview it's not working so how can i fix it?

that's my asp code:
<asp:TextBox style="width:10px;word-wrap:break-word;" id="txt" Runat="Server" Text="adfdafadfadfcvsgsgdasfsaghsgksfjghrwkkjgsfkglsfgsfgsfgsfadfdafadfadfcvsgsgdasfsaghsgksfjghrwkkjgsfkglsfgsfgsfgsfadfdafadfadfcvsgsgdasfsaghsgksfjghrwkkjgsfkglsfgsfgsfgsfadfdafadfadfcvsgsgdasfsaghsgksfjghrwkkjgsfkglsfgsfgsfgsfadfdafadfadfcvsgsgdasfsaghsgksfjghrwkkjgsfkglsfgsfgsfgsf" wrap="true" TextMode="MultiLine"/>

this textbox is wrapping but the following code is not working:

<pre lang="xml"><asp:TemplateField HeaderText="cnt_content">
                            <asp:TextBox ID="cnt_content" runat="server" Text='<%# Bind("cnt_content") %>' style="width:800px;word-wrap:break-word;" wrap="true" TextMode="MultiLine"/>
                       <asp:Label ID="cnt_content" runat="server" Text='<%# Bind("cnt_content") %>'></asp:Label>
                   <ItemStyle Width="800px" wrap="true" />
Updated 4-Sep-13 2:29am

1 solution

Try using
cnt_content.Wrap = True
in code.

Share this answer
Jocelyne El Khoury 4-Sep-13 8:49am    
nop it does not work

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