简体   繁体   中英

How can i dynamically create html elements from C# code behind?

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM