protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["id"] != null && Request.QueryString["path"] != null && Request.QueryString["video_link"] != null) { //TestimonialDAO tdao = new TestimonialDAO(); string id = Request.QueryString["id"]; string fullPath = Request.QueryString["path"]; string link = Request.QueryString["video_link"]; int id_num = Convert.ToInt32(id); if (!System.IO.File.Exists(fullPath)) { Response.Redirect("Home.aspx"); } else { System.IO.File.Delete(fullPath); Course_elearnDAO cdao = new Course_elearnDAO(); cdao.delete_both(id_num, fullPath, link); //cdao.delete_link(id_num, link); //set audit User currentUser = (User)Session["currentUser"]; string filename = Path.GetFileName(fullPath); setAudit(currentUser, "course", "update", id, "deleted material link: " + filename); } Response.Redirect("viewModuleInfo.aspx?id=" + id_num); } }