Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 7th, 2005, 05:22 PM
Registered User
 
Join Date: Aug 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default One Record at a time Or Panel Control Paging

I'm working a Quiz page that loads questions dynamically from SQL server so that I don't have to worry about set number of questions.
At this point all questions load on one page. What I would like to do is load them one question at a time then click next to go on to next question, click previous if needed and store all answers until submit button is clicked when all questions answered. Below is the code I have so far:

DBCommand = New OleDbDataAdapter _
            ("Select SectionQuestionID, QuestionText " _
            & "From SectionQuestions Where CourseSectionID = " _
            & Session("CourseSectionID"), DBConn)
        DBCommand.Fill(DSPageData, "QuizQuestions")

        For I = 0 To DSPageData.Tables("QuizQuestions").Rows.Count - 1

            Dim lcHTML = New LiteralControl
            lcHTML.Text = "<b><br>" _
            & DSPageData.Tables("QuizQuestions").Rows(I).Item("Q uestionText") & "</b><br>"

            pnlQuestions.Controls.Add(lcHTML)

            Dim MyDDL = New RadioButtonList

            TempID = DSPageData.Tables("QuizQuestions").Rows(I).Item("S ectionQuestionID")
            MyDDL.ID = "Q" & TempID

            DBCommand = New OleDbDataAdapter _
                ("Select AnswerText " _
                & "From QuestionAnswers Where SectionQuestionID = " _
                & TempID, DBConn)
            DBCommand.Fill(DSPageData, TempID)

            For J = 0 To DSPageData.Tables(TempID).Rows.Count - 1

                Dim MyItem = New ListItem
                MyItem.Text = DSPageData.Tables(TempID).Rows(J).Item("AnswerText ")
                MyDDL.Items.Add(MyItem)

            Next
            pnlQuestions.Controls.Add(MyDDL)

            Dim lcHTML2 = New LiteralControl
            lcHTML2.Text = "<br><br>"
            pnlQuestions.Controls.Add(lcHTML2)
        Next

What to do, what to do????






Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a Panel control in FormView steve35719 ASP.NET 2.0 Basics 5 August 18th, 2010 12:32 AM
Chapter 4: Using the Panel Control Steve1977 ASP.NET 3.5 Basics 3 September 14th, 2008 01:55 PM
Control panel maz_alaameri ASP.NET 2.0 Professional 0 March 17th, 2008 06:59 AM
How to get panel scroll value at run time akumarp2p C# 0 December 11th, 2006 08:56 AM
lock control panel anyone VB How-To 4 February 1st, 2005 08:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.