Mohammed Al-Ali
Mohammed Al-Ali

Reputation: 75

How to put this HTML code with its style inside a Repeater control?

I have the following HTML code in my ASP.NET application and I want to put it inside a Repeater control, so I can later on give the admin the ability to add more stuff to this repeater.

<div id="wrapper">
            <div id="article">

                        <blockquote>
                    <p>Be Safe</p>
                    <cite>&ndash; Unknown Author</cite>
                </blockquote>

                <blockquote>
                    <p>Accidents hurt – safety doesn’t.</p>
                    <cite>&ndash; Unknown Author</cite>
                </blockquote>

            </div><!-- #article -->
        </div><!-- #wrapper -->

Then, when the admin add something to this repeater, it will be between p tags and cite tags, so how to set that inside the Repeater?

UPDATE: Also, I want to display different items from the database in each page that contains this Repeater. For example, this Repeater shows safety messages. is it possible to show different messages in each page?

Upvotes: 0

Views: 432

Answers (1)

giftcv
giftcv

Reputation: 1662

Try this code

<div id="wrapper">
    <div id="article">
    <asp:Repeater id="Repeater1" runat="server" >
        <blockquote>
            <p><%# Eval("QuoteColumnName") %></p>
            <cite><%# Eval("AuthorColumnName") %></cite>
        </blockquote>
    </asp:Repeater>
    </div><!-- #article -->
</div><!-- #wrapper -->

Upvotes: 1

Related Questions