ow can i use labels with arrays as label(i).text ...
-
I want to explain something about what i want to do. I am making a test-quiz projects for students.There is a lot of questions and choices in the database.I want to relate with questions to labels and choices to radiobuttonlists items. label1.text =question1 radiobuttonlist1.item(0).text=choice1 radiobuttonlist1.item(1).text=choice2 radiobuttonlist1.item(2).text=choice3 radiobuttonlist1.item(3).text=choice4 label2.text=question2 radiobuttonlist2.item(0).text=choice5 radiobuttonlist2.item(1).text=choice6 radiobuttonlist2.item(2).text=choice7 radiobuttonlist2.item(3).text=choice8 . . . I want to do this in a loop and i have to use (i think) label(i).text, radiobuttonlist(i).items(0).text vs. How can i do this?
-
I want to explain something about what i want to do. I am making a test-quiz projects for students.There is a lot of questions and choices in the database.I want to relate with questions to labels and choices to radiobuttonlists items. label1.text =question1 radiobuttonlist1.item(0).text=choice1 radiobuttonlist1.item(1).text=choice2 radiobuttonlist1.item(2).text=choice3 radiobuttonlist1.item(3).text=choice4 label2.text=question2 radiobuttonlist2.item(0).text=choice5 radiobuttonlist2.item(1).text=choice6 radiobuttonlist2.item(2).text=choice7 radiobuttonlist2.item(3).text=choice8 . . . I want to do this in a loop and i have to use (i think) label(i).text, radiobuttonlist(i).items(0).text vs. How can i do this?
you can do it by generating labels and radio buttons dynamically means generate them by writting the code on yours aspx.cs file. for eg. for(i)//loop for labels { label[i];//declare label for(j)// loop for radio buttons of choices { radiobuttons[j]; // declare radion button } }
-
I want to explain something about what i want to do. I am making a test-quiz projects for students.There is a lot of questions and choices in the database.I want to relate with questions to labels and choices to radiobuttonlists items. label1.text =question1 radiobuttonlist1.item(0).text=choice1 radiobuttonlist1.item(1).text=choice2 radiobuttonlist1.item(2).text=choice3 radiobuttonlist1.item(3).text=choice4 label2.text=question2 radiobuttonlist2.item(0).text=choice5 radiobuttonlist2.item(1).text=choice6 radiobuttonlist2.item(2).text=choice7 radiobuttonlist2.item(3).text=choice8 . . . I want to do this in a loop and i have to use (i think) label(i).text, radiobuttonlist(i).items(0).text vs. How can i do this?
Hi there, Because you want to loop through groups of a label and radiobuttonlist controls, so you may consider using a data-bound control like DataList or Repeater, and bind datasource ( questions and choices) from Db to the control. You can read more about the controls in MSDN.