Creating dynamic UI in ASP.NET web forms

2020-06-22 12:26发布

问题:

I need to create a survey page with the following structure read from database.

Survey QuestionA
a) Answer1 [Radio button]
b) Answer2 [Radio button]
c) Answer3 [Radio button]
d) Answer4 [Radio button]

repeats..

The page has many questions that needs to be dynamically added. I need to store the result of the form on in an array of Question object on submit. One way I know to do this is create dynamic UI in a table and get the values by FindControl. Is there a better (elegant) way to do this?