Link to home
Create AccountLog in
Avatar of mgordon-spi
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></HeaderTemplate>
                        <ItemTemplate> <h4><a name='<%#DataBinder.Eval(Container.DataItem, "sAnchor")%>'><%#DataBinder.Eval(Container.DataItem, "sHeader")%></a></h4>
                            <p class="p2"><%#DataBinder.Eval(Container.DataItem, "sNews")%></p>
                        </ItemTemplate>
                    <FooterTemplate></FooterTemplate>
                </asp:Repeater>

        Dim sSQL As String = "SELECT sHeader, sNews, sAnchor FROM tNews"
        Dim daNews As New Data.SqlClient.SqlDataAdapter(sSQL, Myconn.SQLConn)
        Dim dtNews As New Data.DataTable
        daNews.SelectCommand.Parameters.AddWithValue("@Type", 1)
        daNews.Fill(dtNews)
        rtpMainNews.DataSource = dtNews
        rtpMainNews.DataBind()
Avatar of guru_sami
guru_sami
Flag of United States of America image

Avatar of mgordon-spi
mgordon-spi

ASKER

No that hasn't done what I need it to
ASKER CERTIFIED SOLUTION
Avatar of guru_sami
guru_sami
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer