开发者

Generate div box based on database rows

I want to generate div box dynamically based on database row. For example, if sql query retrieves 3 ids then 3 div box should appear one after another. I'm not开发者_C百科 getting logic to implement this.

I'll appreciate your any reply....

Thanks


Use the Repeater control, which can be customized entirely and you can databind it to an SqlDataSource control.

<asp:Repeater ID="Repeater1" runat="server" DataSourceID="FooSqlDataSource">
    <HeaderTemplate><!-- header content --></HeaderTemplate>
    <ItemTemplate>
        <div><!-- content --></div>
    </ItemTemplate>            
    <SeparatorTemplate><!-- separating content --></SeparatorTemplate>
    <AlternatingItemTemplate><!-- alternatig content --></AlternatingItemTemplate>
    <FooterTemplate><!-- footer content --></FooterTemplate>
</asp:Repeater>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜