protected void Page_Load(object sender, EventArgs e) { db = (FlashEntities)Session["db"]; if (Session["user"] == null) { Response.Redirect("~/Default.aspx"); } user = (Student)Session["user"]; if (Session["quiz"] == null) { quiz = new FlashCard(); Session["quiz"] = quiz; } else { quiz = (FlashCard)Session["quiz"]; } if (!IsPostBack) { quiz.Op = "+"; btnAnswer.Enabled = false; lblQuestion.Text = "----------"; lblCorrect.Text = ""; lblWelcome.Text = "Welcome " + user.FirstName + " " + user.LastName; lblMessage.Visible = false; lblCorrect.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { db = (FlashEntities)Session["db"]; }
void Session_Start(object sender, EventArgs e) { Session["db"] = new FlashEntities(); }