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.NET
<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:

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

1 solution

Try using
C#
cnt_content.Wrap = True
in code.

Regards..:)
 
Share this answer
 
v2
Comments
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