Code used in building quiz engine (default pg not redirecting to the start pg) RRS feed

  • Question

  • User1805702908 posted

    I'm working off of the Building a quiz engine tutorial and ran into a problem ... When the user clicks on the next button on the default page (pg gathers fname, lname, email, etc) they should be redirected to the start page. The data is being gathered, but the textbox's clear and user is redirected to the default page. When the If Not statement is removed from the code below it redirects to the start page. Is the If Not statement included in the tutorial needed?

    Partial Class start Inherits System.Web.UI.Page Protected Sub startButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles startButton.Click Response.Redirect("questions.aspx") End Sub Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim al As ArrayList = New ArrayList() Session.Add("AnswerList", al) If Not Request.QueryString("testid") Is Nothing Then Dim testID As Integer = Integer.Parse(Request.QueryString("testid")) Session.Add("QuizID", testID) Else Response.Redirect("default.aspx") End If End Sub End Class
    Wednesday, June 20, 2012 2:20 PM

All replies