开发者

Display Multiple Choice Question on Web Form in Asp.net

In my project I have a web service that returns an Exam object.开发者_如何学Go This object contains a property that returns set of multiple choice questions in Questions[] array. Each Question object in Questions array contains two properties, Question and ChoiceArray. To clear things here's the code,

Exam e = service.GetExam(long CenterID);

Questions[] questions = e.Questions;

foreach(Qestion question in questions)

{

    string q = question.Question;

    Choice[] choice = question.Choice;

}

I need to know a way I can all of these question and their choices onto a form. Since I have these as arrays I can not bind them properly using DataList. Any idea how to display these questions and their choices on to the form and on choice selection, get the value of the selected answer for each question back.

Thanks.


You can use this method to convert the array to a List<string>:

http://www.dotnetspider.com/resources/19560-Convert-from-string-array-to-list-t.aspx

You can then bind to a RadioButtonList.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜