protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { UserBO ob = new UserBO(); try { ob.userid = Session["User"].ToString(); ob.coursecode = Session["CourseSelected"].ToString(); } catch { Response.Redirect("UserMain.aspx"); } clsBLL logicob = new clsBLL(); if (logicob.iscourseopenedBLL(ob) == "Y") { DataTable questiontable = logicob.QuestionTableCreatorBLL(ob); countofQuestions = questiontable.Rows.Count; if (countofQuestions > 0) { startingQuestion = 1; rowno = startingQuestion - 1; displayQuestion(questiontable); } else { QuestionText.Text = "Sorry There are no questions for this course"; } test.DataSource = questiontable; test.DataBind(); SubmitQuestions.Visible = false; } else { Response.Redirect("UserMain.aspx"); } } }