I am creating a meeting booking application using .NET, and i want the approver page to be populated with collapsible bootstrap panels for each booking, each panel will have the booking info in the body. So once i get the booking info from my database how do i create the elements and populate it with data?
1 Answer
There are two approaches I can recommend. The first is using ASP.Net's razor markup to load information dynamically. This follows a Model, View, Controller approach and more information can be found here -> Asp.Net Razor Guide .
An arguably easier approach would be to use Angular.js to load elements and data dynamically while making api calls to your application to fetch data from your database. Angular is very convenient and designed with scenarios just like this in mind.
1 Comment
Mr.Bigglesworth
I say arguably as this requires a developer to be more comfortable with front end development.
Repeateris a good way to display a number of elements where the exact number to create is not known until runtime, but all have similar properties. It's strongly typed so you can bind a list of objects to it (e.g. the DTO objects from your database) or even a DataTable direct from the database and then it will loop through all the objects and render one instance of the HTML for each item supplied to it. Here's a sample tutorial: msdn.microsoft.com/en-us/library/zzx23804(v=vs.85).aspx there are many others around online