How to keep a running score?
<p>I am making a mini test and I am not sure how to go about making a running score that will update the current score after the user submits the test. The score can fluctuate by 25 points depending on if the question goes from wrong to right, and vice versa.</p>

<pre><code>public partial class _Default : System.Web.UI.Page
{
private int totalScore = 0;

public void IncrementScore()
{
    totalScore += 25;
}

protected void Page_Load(object sender, EventArgs e)
{

    if (!IsPostBack)
    {
        lblHeader.Text = "quiz not taken";
    }
    else
    {
        lblHeader.Text = "Score: " + totalScore;
    }
}

protected void Submit_Click(object sender, EventArgs e)
{

    /***************************************************************************/
    if (IsValid)
        if (txtAnswer.Text.Equals("primary", StringComparison.InvariantCultureIgnoreCase))
        {
            lblQuestionResult1.ForeColor = System.Drawing.Color.Green;
            lblQuestionResult1.Text = "Correct";
        }
        else
        {
            lblQuestionResult1.ForeColor = System.Drawing.Color.Red;
            lblQuestionResult1.Text = "Incorrect";
        }

    /***************************************************************************/
    if (ddList.SelectedItem.Text.Equals("M:N"))
    {
        lblQuestionResult2.ForeColor = System.Drawing.Color.Green;
        lblQuestionResult2.Text = "Correct";
    }
    else
    {
        lblQuestionResult2.ForeColor = System.Drawing.Color.Red;
        lblQuestionResult2.Text = "Incorrect";
    }

    /***************************************************************************/
    if (RadioButton4.Checked == true)
    {
        lblQuestionResult3.ForeColor = System.Drawing.Color.Green;
        lblQuestionResult3.Text = "Correct";
    }
    else
    {
        lblQuestionResult3.ForeColor = System.Drawing.Color.Red;
        lblQuestionResult3.Text = "Incorrect";
    }

    /***************************************************************************/
    lblQuestionResult4.ForeColor = System.Drawing.Color.Red;
    lblQuestionResult4.Text = "Incorrect";
    if (Answer2.Checked &amp;&amp; Answer3.Checked &amp;&amp; !Answer1.Checked &amp;&amp; !Answer4.Checked)
    {
        lblQuestionResult4.ForeColor = System.Drawing.Color.Green;
        lblQuestionResult4.Text = "Correct";
    }
}
}
</code></pre>
