ASP.NET – How to dynamically generate Labels

asp.netdynamic-controls

I am doing a project on Flight Booking system. My part is to enter the details of the passengers travelling. These passengers may include Adults as well as children. So I need to dynamically generate separate labels and text boxes for all the passengers travelling so that details of all them can be entered.

How can I do that?

Best Answer

You may want to look at GridViews / DetailsView / Repeaters etc. You can then write some databinding code to show the different labels for each record as required.

As others have said though, a bit more information is needed to answer the question properly. Maybe you could post some of the code you have already so we can point you in the next direction.