Can some one please help me with this error
here is my code :
protected void BtnAddQuestion_Click(object sender, EventArgs e)
{
Trace.IsEnabled = true;
Question q = new Question();
q.Qtitle = Server.HtmlEncode(txtQ1.Text);
q.A1 = Server.HtmlEncode(txtq1op1.Text);
q.A2 = Server.HtmlEncode(txtq1op2.Text);
q.A3 = Server.HtmlEncode(txtq1op3.Text);
q.A4 = Server.HtmlEncode(txtq1op4.Text);
ArrayList ql = (ArrayList)Session["QuestionList"];
ql.Add(q);
Session.Add("QuestionList", ql);
}
I get a error at ql.add(q).
the error description:
System.NullReferenceException was unhandled by user code
Message="Object reference not set to an instance of an object."
Source="App_Web_9ork_psh"
StackTrace:
...
Go to the complete details ...