Formview Line Breaks

  • Thread starter Thread starter MDB
  • Start date Start date
M

MDB

Hello All, I have a label in a form view that I need to have display the
line breaks. Is there an easy way to do this? For some reason, I havn't
been able to find a straigh answer on this.

Here is what I have:

<asp:FormView ID="FormView1" runat="server" DataKeyNames="ID"
DataSourceID="SqlDataSource2" Width="565px">
<itemtemplate>
<table width="565" style="table-layout: fixed;word-break:break-all" >
<tr>
<td style="color: white; background-color: #d40000; text-align:
center">
&nbsp;<b><asp:Label ID="titleLabel" runat="server" Text='<%#
Bind("title") %>'></asp:Label></b>
</td>
</tr>
<tr>
<td align="left" style="background-color: #e0e0e0">
&nbsp;<asp:Label ID="blogentryLabel" runat="server"
Text='<%# Server.HtmlEncode(Eval("blogentry").ToString())
%>'></asp:Label></td>
</tr>

</table>
</itemtemplate>
</asp:FormView>


It displays the text like this (one continuous line):


as fsdajfkl jdjsdkfa jdsklfj;a fjf asdkf;lj kl;fajdf; dkjf daf;lsaf
fsakffas' fafds;f kdjf fafds;f kdjf ds;f kdjf fafds;f kdjf sajhf dsafkaj
fdfkashf oidsahfda fhadsifjep89fa jfsafdajf 9o8afsafkasca ewauifa oiduaf
aifuosad oiaufp ndsaopi ufwaoiauf snkzpoweqiurf ajsdopfueqw

If I view this source it is displayed correctly with the line breaks:

sjadfjl akjf

aksj fsakf

asd hfsadf asdf lkwajf oaiu asjkldsj oiqua

I am sorry for asking a question that appears to have been asked multiple
time however, I still can not seem to get it figured out.

Thanks In Advance
 
That worked great, now I have a new question, how do I get to to word wrap?
I ahve the width set to 565 but the lines never break.
 
Back
Top