开发者

Generate div box based on database rows

开发者 https://www.devze.com 2023-04-01 22:21 出处:网络
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

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

精彩评论

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