How to fix this error to prevent from going back to the Quiz page and change his answer?
<p>The web application that I am developing right now has something called quiz engine which provides users with short quizzes which consist of one question or more. Now, I have a problem with taking/ answering the quiz:
When the user finishes the quiz that consists of 4 questions and he goes to the Result Page and he can go back (using back arrow in the browser) to the Quiz page and answers any question again and this should not be happened and I don't know how to prevent it</p>

<p>For creating the Quiz engine, I used  the Toturial for the Quiz Engine in the ASP.NET website for creating what I have.</p>

<p>ASP.NET code:</p>

<pre><code>&lt;tr&gt;
                &lt;td&gt;
                    &lt;asp:DetailsView ID="questionDetails" runat="server" Height="50px" Width="550px" AutoGenerateRows="False" CellPadding="4" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None"&gt;
                        &lt;FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /&gt;
                        &lt;CommandRowStyle BackColor="#E2DED6" Font-Bold="True" /&gt;
                        &lt;RowStyle BackColor="#F7F6F3" ForeColor="#333333" CssClass="generaltext" /&gt;
                        &lt;FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" CssClass="boldtext" Width="80px" /&gt;
                        &lt;PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" /&gt;
                        &lt;Fields&gt;
                            &lt;asp:BoundField DataField="Question" HeaderText="Question:" SortExpression="Question" /&gt;
                            &lt;asp:BoundField DataField="Answer1" HeaderText="A:" SortExpression="Answer1" /&gt;
                            &lt;asp:BoundField DataField="Answer2" HeaderText="B:" SortExpression="Answer2" /&gt;
                            &lt;asp:BoundField DataField="Answer3" HeaderText="C:" SortExpression="Answer3" /&gt;
                            &lt;asp:BoundField DataField="Answer4" HeaderText="D:" SortExpression="Answer4" /&gt;
                        &lt;/Fields&gt;
                        &lt;HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /&gt;
                        &lt;EditRowStyle BackColor="#999999" /&gt;
                        &lt;AlternatingRowStyle BackColor="White" ForeColor="#284775" CssClass="generaltext" /&gt;
                    &lt;/asp:DetailsView&gt;
                    &amp;nbsp;
                    &lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="&lt;%$ ConnectionStrings:testConnectionString %&gt;" SelectCommand="SELECT [QuestionID], [Question], [Answer1], [Answer2], [Answer3], [Answer4], [CorrectAnswer], [QuestionOrder] FROM [Question] WHERE ([QuizID] = @QuizID) ORDER BY [QuestionOrder]"&gt;
                        &lt;SelectParameters&gt;
                            &lt;asp:SessionParameter SessionField="QuizID" Type="Int32" Name="QuizID" DefaultValue="0" /&gt;
                        &lt;/SelectParameters&gt;
                    &lt;/asp:SqlDataSource&gt;
                &lt;/td&gt;
            &lt;/tr&gt;

            &lt;%--&lt;tr&gt;
                &lt;td&gt;&amp;nbsp;
                &lt;/td&gt;
            &lt;/tr&gt;--%&gt;

            &lt;tr&gt;
                &lt;td class="boldtext"&gt;
                    &lt;strong&gt;Your Answer:&lt;/strong&gt;&amp;nbsp;
                &lt;asp:DropDownList ID="answerDropDownList" runat="server"&gt;
                            &lt;asp:ListItem Value="A"&gt;A&lt;/asp:ListItem&gt;
                            &lt;asp:ListItem Value="B"&gt;B&lt;/asp:ListItem&gt;
                            &lt;asp:ListItem Value="C"&gt;C&lt;/asp:ListItem&gt;
                            &lt;asp:ListItem Value="D"&gt;D&lt;/asp:ListItem&gt;
                        &lt;/asp:DropDownList&gt;
                &lt;/td&gt;
            &lt;/tr&gt;
</code></pre>

<p>My Code-Behind:</p>

<p>This is the code that is responsible for saving the answers:</p>

<pre><code>protected void Page_Load(object sender, EventArgs e)
    {

        questionDetails.DataBind();

        answerDropDownList.SelectedIndex = 0;

        if (questionDetails.PageCount == 1)
        {
            nextButton.Text = "Finished";
        } 
    }

    protected void nextButton_Click(object sender, EventArgs e)
    {
        // Save off previous answers
        System.Data.DataRowView dr = (System.Data.DataRowView)questionDetails.DataItem;

        // Create Answer object to save values
        Answer a = new Answer();
        a.QuestionID = dr["QuestionOrder"].ToString();
        a.CorrectAnswer = dr["CorrectAnswer"].ToString();
        a.UserAnswer = answerDropDownList.SelectedValue.ToString();

        ArrayList al = (ArrayList)Session["AnswerList"];

        var oldAnswer = al.ToArray().Where(ans =&gt; (ans as Answer).QuestionID == a.QuestionID);
        if (oldAnswer.Count() != 0)
        {
            a = oldAnswer.FirstOrDefault() as Answer;
            a.CorrectAnswer = dr["CorrectAnswer"].ToString();
            a.UserAnswer = answerDropDownList.SelectedValue.ToString();
        }
        else
        {
            al.Add(a);
        }


        if (questionDetails.PageIndex == questionDetails.PageCount - 1)
        {
            // Go to evaluate answers
            Response.Redirect("Results.aspx");
        }
        else
        {
            questionDetails.PageIndex++;
        }

        if (questionDetails.PageIndex == questionDetails.PageCount - 1)
        {
            nextButton.Text = "Finished";
        }

    }
</code></pre>

<p>The following code is responsible for saving the result:</p>

<pre><code>protected void Page_Load(object sender, EventArgs e)
    {
        ArrayList al = (ArrayList)Session["AnswerList"];

        if (al == null)
        {
            Response.Redirect("default.aspx");
        }

        resultGrid.DataSource = al;
        resultGrid.DataBind();

        // Save the results into the database.
        if (IsPostBack == false)
        {
            // Calculate score
            double questions = al.Count;
            double correct = 0.0;


            for (int i = 0; i &lt; al.Count; i++)
            {
                Answer a = (Answer)al[i];
                if (a.Result == Answer.ResultValue.Correct)
                    correct++;
            }

            double score = (correct / questions) * 100;
            string username = HttpContext.Current.User.Identity.Name.ToString().Replace("ARAMCO\\", "");
            SqlDataSource userQuizDataSource = new SqlDataSource();
            userQuizDataSource.ConnectionString = ConfigurationManager.ConnectionStrings["testConnectionString"].ToString();
            userQuizDataSource.InsertCommand = "INSERT INTO [UserQuiz] ([QuizID], [DateTimeComplete], [Score], [Username]) VALUES (@QuizID, @DateTimeComplete, @Score, @Username)";

            userQuizDataSource.InsertParameters.Add("QuizID", Session["QuizID"].ToString());
            userQuizDataSource.InsertParameters.Add("DateTimeComplete", DateTime.Now.ToString());

            // "N4" is for displaying four decimal places, regardless of what the value is 
            userQuizDataSource.InsertParameters.Add("Score", score.ToString("N4"));

            userQuizDataSource.InsertParameters.Add("Username", username);

            int rowsAffected = userQuizDataSource.Insert();
            if (rowsAffected == 0)
            {
                // Let's just notify that the insertion didn't
                // work, but let' s continue on ...
                errorLabel.Text = "There was a problem saving your quiz results into our database.  Therefore, the results from this quiz will not be displayed on the list on the main menu.";


            }

        }


    }


    protected void resultGrid_SelectedIndexChanged(object sender, EventArgs e)
    {
        SqlDataSource1.FilterExpression = "QuestionOrder=" + resultGrid.SelectedValue;
    }
</code></pre>

<p><strong>So now how I can prevent the user from going back to the Quiz when he is in the Result page?</strong></p>
