1
Reply

Using a repeater control, how can I dynamically add <div>?

Bob Herrmann

Bob Herrmann

May 24 2017 7:17 AM
237
I have a web page that is basically a dashboard.  It contains reports developed with a product named WebFocus.  I do not create the reports.  Others do that.  Each WebFocus report seems to need it's own <div> statement.  It should look like this:
 
<div id="Dash1" runat="server"></div>
 
The reports are stored in a SQL table.  So I want to read thru this table and create the reports dynamically.  So if there are 5 reports, I want 5 lines like above but each id will be Dash1, Dash2, Dash3, Dash4, and Dash5.
 
I thought about using a repeater control but I wasn't sure how to dynamically build the <div> statements.  Or is there a better way to do this?
 
Thanks in advance. 

Answers (1)