Hey superguppie i have already have my pagesize equal to 1. My problem is:
How to keep the radiobutton's value after i click "Next Question" or "Previous Question". Let me show you what i have done so far...
I want when i click next to show another question and keep the value the user clicked and when i click previous to "read" the value that the user clicked on the previous question. From my search so far i think that i have to do something with the QuestionGroups
and use a session or a viewstate to keep the value. Sorry but I dont know much and i am trying to learn :(
Ophelia
Member
231 Points
214 Posts
Re: Suggestions for a Quiz
Apr 05, 2012 11:50 AM|LINK
Hey superguppie i have already have my pagesize equal to 1. My problem is:
How to keep the radiobutton's value after i click "Next Question" or "Previous Question". Let me show you what i have done so far...
I want when i click next to show another question and keep the value the user clicked and when i click previous to "read" the value that the user clicked on the previous question. From my search so far i think that i have to do something with the QuestionGroups and use a session or a viewstate to keep the value. Sorry but I dont know much and i am trying to learn :(
<asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1"> <AlternatingItemTemplate> <span style=""> <asp:RadioButton ID="RadioButton1" runat="server" GroupName="Questions" value="1" Text='<%# Eval("Answer1") %>' /> <br /> <asp:RadioButton ID="RadioButton2" runat="server" GroupName="Questions" value="2" Text='<%# Eval("Answer2") %>' /> <br /> <asp:RadioButton ID="RadioButton3" runat="server" GroupName="Questions" value="3" Text='<%# Eval("Answer3") %>' /> <br /> <asp:RadioButton ID="RadioButton4" runat="server" GroupName="Questions" value="4" Text='<%# Eval("Answer4") %>' /> <br /> </span> </AlternatingItemTemplate> <EmptyDataTemplate> <span>No data was returned.</span> </EmptyDataTemplate> <ItemTemplate> <span style=""> <asp:RadioButton ID="RadioButton1" runat="server" GroupName="Questions" value="1" Text='<%# Eval("Answer1") %>' /> <br /> <asp:RadioButton ID="RadioButton2" runat="server" GroupName="Questions" value="2" Text='<%# Eval("Answer2") %>' /> <br /> <asp:RadioButton ID="RadioButton3" runat="server" GroupName="Questions" value="3" Text='<%# Eval("Answer3") %>' /> <br /> <asp:RadioButton ID="RadioButton4" runat="server" GroupName="Questions" value="4" Text='<%# Eval("Answer4") %>' /> <br /> </span> </ItemTemplate> <LayoutTemplate> <div id="itemPlaceholderContainer" runat="server" style=""> <span runat="server" id="itemPlaceholder" /> </div> <div style=""> <asp:DataPager ID="DataPager1" runat="server" PageSize="1"> <Fields> <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="False" ShowLastPageButton="False" /> </Fields> </asp:DataPager> </div> </LayoutTemplate> <SelectedItemTemplate> <span style=""> <asp:RadioButton ID="RadioButton1" runat="server" GroupName="Questions" value="1" Text='<%# Eval("Answer1") %>' /> <br /> <asp:RadioButton ID="RadioButton2" runat="server" GroupName="Questions" value="2" Text='<%# Eval("Answer2") %>' /> <br /> <asp:RadioButton ID="RadioButton3" runat="server" GroupName="Questions" value="3" Text='<%# Eval("Answer3") %>' /> <br /> <asp:RadioButton ID="RadioButton4" runat="server" GroupName="Questions" value="4" Text='<%# Eval("Answer4") %>' /> <br /> </span> </SelectedItemTemplate> </asp:ListView> </ContentTemplate> </asp:UpdatePanel>