I'm really new to asp.net and web design. I attempting to make an event reservation site. I'm using bootstrap and have the layout pretty well completed. Inside the layout I have an image and other data about the event and then a button to proceed to the
reservation info collection screen. My problem is how do I repeat the layout when there are more than one result. The data is being placed inside a DataTable and I was attempting to look through the layout with a while statement. The problem seems to be that
the controls all have the same IDs which makes it difficult for assigning the images to the controls and to have a separate form for each event. Is there a better way to loop through all the data and recreate the row/col layout for each record while assigning
different IDs to the controls to make the page more dynamic?
None
0 Points
2 Posts
Repeating bootstrap layout with each database/datatable result
Jan 13, 2020 09:34 PM|sparky256DSL|LINK
I'm really new to asp.net and web design. I attempting to make an event reservation site. I'm using bootstrap and have the layout pretty well completed. Inside the layout I have an image and other data about the event and then a button to proceed to the reservation info collection screen. My problem is how do I repeat the layout when there are more than one result. The data is being placed inside a DataTable and I was attempting to look through the layout with a while statement. The problem seems to be that the controls all have the same IDs which makes it difficult for assigning the images to the controls and to have a separate form for each event. Is there a better way to loop through all the data and recreate the row/col layout for each record while assigning different IDs to the controls to make the page more dynamic?
All-Star
52961 Points
23563 Posts
Re: Repeating bootstrap layout with each database/datatable result
Jan 13, 2020 09:49 PM|mgebhard|LINK
Look in in to using standard ASP.NET bound control like the Repeater to create a repeating layout.
https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.repeater?view=netframework-4.8
I recommend learning MVC over Web Forms for new development.
None
0 Points
2 Posts
Re: Repeating bootstrap layout with each database/datatable result
Jan 14, 2020 01:10 AM|sparky256DSL|LINK
Thank you! I will look into all of this!