yangchin78
MIS
Hello,
I'm trying to create a quiz where there will be multiple lines of questions, pulled from a database. Each question will have several choices, only one of which will be selectable per line. The code I currently have is this
for each rw as datarow in ds1.tables("tblQuestions").rows
grpAnswers.id = "Question" & i
grpAnswers.Items.Add(New ListItem("Yes","1"))
grpAnswers.Items.Add(New ListItem("No","2"))
grpAnswers.Items.Add(New ListItem("Maybe","3"))
phQuiz.Controls.Add(grpAnswers)
i = i + 1
next
My question is, how do I get the selected value for each Radio Button List on the page? It looks like I have to use FindControl, but I'm not sure exactly how to write the code that I need. Any help would be appreciated. Thanks in advance.
I'm trying to create a quiz where there will be multiple lines of questions, pulled from a database. Each question will have several choices, only one of which will be selectable per line. The code I currently have is this
for each rw as datarow in ds1.tables("tblQuestions").rows
grpAnswers.id = "Question" & i
grpAnswers.Items.Add(New ListItem("Yes","1"))
grpAnswers.Items.Add(New ListItem("No","2"))
grpAnswers.Items.Add(New ListItem("Maybe","3"))
phQuiz.Controls.Add(grpAnswers)
i = i + 1
next
My question is, how do I get the selected value for each Radio Button List on the page? It looks like I have to use FindControl, but I'm not sure exactly how to write the code that I need. Any help would be appreciated. Thanks in advance.