G
Guest
Hi,
I am working on a questionnaire. I have displayed a questionnaire using a
repeater control. The itemtemplate is as below (quite cut down):
<ItemTemplate>
<tr><td>
<%# DataBinder.Eval(Container.DataItem, "question")%>
</td></tr>
<tr><td>
<asp:CheckBox id="chkboxA" runat="server" Checked="false" visible='<%#
DataBinder.Eval(Container.DataItem, "choiceA").ToString() != "" %>' >
</asp:CheckBox>
<%# DataBinder.Eval(Container.DataItem, "choiceA")%>
</td></tr>
<tr><td>
<asp:CheckBox id="chkboxB" runat="server" Checked="false" visible='<%#
DataBinder.Eval(Container.DataItem, "choiceB").ToString() != "" %>' >
</asp:CheckBox>
<%# DataBinder.Eval(Container.DataItem, "choiceB")%>
</td></tr> ....
I want to display each question (there are 50) questions on a separate
webpage, one after another. My question is:
1) How do I structure the webpage .aspx page to display 50 consecutive
questions ? Do I have to bind the repeater control to the dataset each time?
The questions that I want to display is taken from a composite table each
time. There has to be a better way than that.
2) how do I store the user's answers eg. Q1 has 4 choices, which the user
has checked. Do I use an array ? If yes, then how do I retrieve the data from
the repeater control into the array and then retrieve the data from the array
into the dataset to store into the db ?
All suggestions are welcomed. Thanks.
Andrew.
I am working on a questionnaire. I have displayed a questionnaire using a
repeater control. The itemtemplate is as below (quite cut down):
<ItemTemplate>
<tr><td>
<%# DataBinder.Eval(Container.DataItem, "question")%>
</td></tr>
<tr><td>
<asp:CheckBox id="chkboxA" runat="server" Checked="false" visible='<%#
DataBinder.Eval(Container.DataItem, "choiceA").ToString() != "" %>' >
</asp:CheckBox>
<%# DataBinder.Eval(Container.DataItem, "choiceA")%>
</td></tr>
<tr><td>
<asp:CheckBox id="chkboxB" runat="server" Checked="false" visible='<%#
DataBinder.Eval(Container.DataItem, "choiceB").ToString() != "" %>' >
</asp:CheckBox>
<%# DataBinder.Eval(Container.DataItem, "choiceB")%>
</td></tr> ....
I want to display each question (there are 50) questions on a separate
webpage, one after another. My question is:
1) How do I structure the webpage .aspx page to display 50 consecutive
questions ? Do I have to bind the repeater control to the dataset each time?
The questions that I want to display is taken from a composite table each
time. There has to be a better way than that.
2) how do I store the user's answers eg. Q1 has 4 choices, which the user
has checked. Do I use an array ? If yes, then how do I retrieve the data from
the repeater control into the array and then retrieve the data from the array
into the dataset to store into the db ?
All suggestions are welcomed. Thanks.
Andrew.