protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["pageNumber"] != null) { pageNumber = int.Parse(Request.QueryString["pageNumber"]); } else { if (Request.Cookies["ExamType"] == null) { Response.Write("<script>window.parent.location.href = '../LogIn.aspx'</script>"); } else { string examType = Request.Cookies["ExamType"].Value; theExams = examBll.GetTheExamByPage(ref pageNumber, ref totalPage, ref count, examType); } } }