Exemple #1
0
        protected void dlCommandItem(object sender, DataListCommandEventArgs e)
        {
            string filePath = ((Label)e.Item.FindControl("lblLFileLocation")).Text;

            if (e.CommandName == "View")
            {
                DownloadFile(filePath, true);
            }
            else
            {
                //Call to delete the lecture note
                //Get the lecture ID
                Int32 lectureID = Convert.ToInt32(((Label)e.Item.FindControl("lblLectureNoteID")).Text);
                //Get file location of the lecture note.
                string filePathToDelete = ((Label)e.Item.FindControl("lblLFileLocation")).Text;
                LectureNoteController.Delete(lectureID);
                File.Delete(filePath);
                Helper.ViewLectureNote(dlLectureNotes, Session["CourseID"].ToString());
            }
        }