protected void Page_Load(object sender, EventArgs e) { db = new DBConnection(); con = new SqlConnection(db.ConnState); sq = new SolvedQuestions(); lstSol = new List <SolvedQuestions>(); }
protected void Page_Load(object sender, EventArgs e) { db = new DBOperations(); SolvIndex = new List <int>(); storeSelectedOptions = new List <SolvedQuestions>(); Temp = new List <SolvedQuestions>(); obj = new SolvedQuestions(); UnSolvIndex = new List <int>(); examid = Convert.ToInt32(Session["examid"].ToString()); if (ViewState["Q_Count"] != null) { queCount = Convert.ToInt32(ViewState["Q_Count"].ToString()); } if (ViewState["marks"] != null) { marks = Convert.ToInt32(ViewState["marks"].ToString()); } if (!IsPostBack) { if (Session["stud_id"] == null) { Response.Redirect("~/index.aspx"); } else { loadstudentDetails(); Session["storeSelectedOptions"] = null; ViewState["rowNo"] = rowNo = 1; ViewState["TotalMarks"] = TotalMarks = 0; DataSet ds1 = db.RetriveAllQuetions(examid); ViewState["marks"] = marks = Convert.ToInt32(ds1.Tables[0].Rows[0]["marks"].ToString()); ViewState["Q_Count"] = queCount = ds1.Tables[0].Rows.Count; loadQuestions(); } } }