mgordon-spi
asked on
Datarepeater add line break to dataitem
I have a datarepeater drawing news items from the database and I want it to acknowledge and display the line breaks.
My code is:
<asp:Repeater ID="rtpMainNews" runat="server">
<HeaderTemplate></HeaderTe mplate>
<ItemTemplate> <h4><a name='<%#DataBinder.Eval(C ontainer.D ataItem, "sAnchor")%>'><%#DataBinde r.Eval(Con tainer.Dat aItem, "sHeader")%></a></h4>
<p class="p2"><%#DataBinder.E val(Contai ner.DataIt em, "sNews")%></p>
</ItemTemplate>
<FooterTemplate></FooterTe mplate>
</asp:Repeater>
Dim sSQL As String = "SELECT sHeader, sNews, sAnchor FROM tNews"
Dim daNews As New Data.SqlClient.SqlDataAdap ter(sSQL, Myconn.SQLConn)
Dim dtNews As New Data.DataTable
daNews.SelectCommand.Param eters.AddW ithValue(" @Type", 1)
daNews.Fill(dtNews)
rtpMainNews.DataSource = dtNews
rtpMainNews.DataBind()
My code is:
<asp:Repeater ID="rtpMainNews" runat="server">
<HeaderTemplate></HeaderTe
<ItemTemplate> <h4><a name='<%#DataBinder.Eval(C
<p class="p2"><%#DataBinder.E
</ItemTemplate>
<FooterTemplate></FooterTe
</asp:Repeater>
Dim sSQL As String = "SELECT sHeader, sNews, sAnchor FROM tNews"
Dim daNews As New Data.SqlClient.SqlDataAdap
Dim dtNews As New Data.DataTable
daNews.SelectCommand.Param
daNews.Fill(dtNews)
rtpMainNews.DataSource = dtNews
rtpMainNews.DataBind()
Try this: http://forums.asp.net/t/1027728.aspx/1
ASKER
No that hasn't done what I need it to
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.