Reccomended ways to add data-driven checkboxes/textboxes, etc?

J

Jim Bancroft

Hi everyone,

I need to add a few rows' worth of web controls to my page. It's supposed
to work like this: I have a DataTable to loop through, and every row in it
requires a corresponding text and checkbox on the form.

What would be a good way to go about adding the controls to my page while
walking through the DataTable? Should I attach a DataGrid to the table, and
put my web controls in that? That could work, but I'm not sure if that's
overengineering or if there's a preferred way. If you have any tips or
advice I'd be grateful to hear them, and thanks!
 
I

intrader

Hi everyone,

I need to add a few rows' worth of web controls to my page. It's supposed
to work like this: I have a DataTable to loop through, and every row in it
requires a corresponding text and checkbox on the form.

What would be a good way to go about adding the controls to my page while
walking through the DataTable? Should I attach a DataGrid to the table, and
put my web controls in that? That could work, but I'm not sure if that's
overengineering or if there's a preferred way. If you have any tips or
advice I'd be grateful to hear them, and thanks!
A DataGrid would do it. So will a Repeater.
 
J

Jim Bancroft

Thanks for the link. What you have will do the trick; I was just curious
more than anything else whether there were other ways of doing it.

For example in the old ASP/ADO days it was easy to loop through a recordset
and output appropriate html tags each time through. Using a DataGrid works
fine, but it's a little more work than in the old days.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top