I have a code and an array inside like this one :
using System;
public partial class bug : System.Web.UI.Page
{
double[] Score = new double[10];
protected void Page_Load(object sender, EventArgs e)
{
load the form with questions from database (but show only one)
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
when this clicked, evaluate the answer from TextBox1 and write the score to Score[questionnumber].
}
protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
{
go to the question of the clicked Hyperlink's number.
}
}
So, what happens is, I open this website, I see there first question, I put my answer and submit it, then it returns the score of my first question, after that I click 2nd question's hyperlink, and form takes me to my 2nd question, here is the problem happens, I don't know why but the array (Score array) gets resetted here, so when I submit my answer for 2nd question, it puts the answer to Score[0] instead of putting it to the index of the number of question number. maybe it re-initialize again because of that. So, What should I do to keep not happening it being resetted? Please help, I really need it.