简体   繁体   中英

ASP.NET Dynamic page generation

I'm developing an online survey application for my University project.

I managed to save the newly created survey data into the database and now the problem is that i don't know how to populate the saved questions into a page (which sent to the customer to get responses) dynamically. And that response data should also be saved to the database.

Can anyone please help me on this. I'm using ASP.NET for this.

Thanks

First you need some database calls to get the questions.

  • select (id, description) from questions

Then you need to populate this information into a Data Control. I suggest a DataList or Repeater.

Assuming that the answers will be yes/no, you also need to add something like a RadioButtonList to collect the yes or no selection to the ItemTemplate.

You will need to submit the form, so a Button should be used. In the click event, loop through each row of the DataList/Repeater and gather the answers.

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