protected void Page_Load(object sender, EventArgs e) { if (Session["admin"] == null) { Response.Redirect("homepage.aspx"); } else { Voucher vcher = new Voucher(); vcherList = vcher.GetAllVouchersByName(); if (vcherList.Count == 0) { no.Visible = true; } if (Request.QueryString["voucherId"] != null) { vchers = vcher.DeleteVoucherById(int.Parse(Request.QueryString["voucherId"])); panelSuccess.Visible = true; vcherList = vcher.GetAllVouchersByName(); if (vcherList.Count == 0) { no.Visible = true; } } } }