protected void downloadPDFBtn_Click(object sender, ImageClickEventArgs e) { //calls the method to create the datatable GetCustomMadeDataTable(); //calls the method to generate the pdf from the datatable GeneratePDF(table); //popup error message when staff choose one of the field under the Reminder field and click on the "download PDF" button. if (DropDownList1.SelectedItem.Value != null) { MessageBox.Show("There is no timetable available for"); Response.Redirect("DownloadTimetable.aspx"); }