Dynamic Tables

C

Carlos Gomez

I used to develop with Classic ASP. Now I'm learning ASP.NET

I used to create tables 'on-the-fly' using recordsets. My code
would loop through the recorset.Fields to make the headers.
If I added a field to the table, I didn't have to update my code.
I liked the fact that I could test for a field.name to customize
a column title if I wanted to. Same goes for the rows, I often inserted
something in the cells of certain columns (textboxes, links, etc.)

Correct me if I'm wrong, but the only way I have found to achive this
is by using a Repeater. I would appreciate your opinions on any other
way to do this.

The problem with the repeater (to my best knowledge) is that you have
to know the fields of the table beforehand. The DataGrid doesn't cut it because I
still want to modify a title if it matches certain name and insert something
on the row cell if it is part of that column. Any way to dynamically create
a table regardless of the fields?

Thanks in advance.
 
D

Do Quyet Tien

You can using place holder tag in where you'd like to place table, and
dynamic generate HTML content based-on recordsets, and assign that content
(string) to place holder's innerHTML property.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top