0

i'm trying to wrap a textbox but i'm getting that word-wrap is not a know css property name and it's not working so how can i fix it?

<asp:TemplateField HeaderText="cnt_content">
                <EditItemTemplate>
                    <asp:TextBox ID="cnt_content" runat="server" Text='<%# Bind("cnt_content") %>'  wrap="true" TextMode="MultiLine"></asp:TextBox>
                </EditItemTemplate> 
                <ItemTemplate> 
                    <asp:Label ID="cnt_content" runat="server" Text='<%# Bind("cnt_content") %>'></asp:Label> 
                </ItemTemplate> 
                <ItemStyle Width="800px" wrap="true" />
            </asp:TemplateField> 

note that my textbox is in a gridview and i'm working on asp.net using vb.net

User7291
  • 1,095
  • 3
  • 29
  • 71

4 Answers4

2

Correct way to using this is word-wrap: break-word;

Vladimir
  • 377
  • 1
  • 6
  • ok i changed it to word-wrap: break-word; but i'm still getting the same error – User7291 Sep 04 '13 at 11:32
  • Try to close your css file in VWD IDE and re-compile the error will go away. Source - http://forums.asp.net/t/1438035.aspx/1. – Vladimir Sep 04 '13 at 11:46
1
1.goto options in Visual studio.
2.select Text-editor.
3.select CSS
4.select Miscellaneous
5.Under detect errors tick that aswarning check box.
6.Now your error will become a warning in Visual studio.
7.IN browser yopu will get the result.
Sasidharan
  • 3,676
  • 3
  • 19
  • 37
0

Why not using asp.net's own TextBox WordWrap property.

<asp:TextBox Wrap="True|False" />

TextMode property to "Multiline"

Its working for me

enter image description here

Jibran Khan
  • 3,236
  • 4
  • 37
  • 50
0

Don't worry, Visual Studio does not understand word-wrap property for Div.So it gives you green line.! So run your page & see output with <div style="word-wrap:break-word;">

Pratik Patel
  • 78
  • 1
  • 9