Hi currently I am doing a online calendar project.
There ia a drop-down list tied to reminder(label) and when i select any of the reminder options in the ddl and click on downlaod pdf button, there should be a message box that tells users they are not allow to select any of the reminder options for PDF. This is the code that i have entered:
Bash
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");
}
Thanks ur help is deeply appreciated. Hope to hear from u soon!
6 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Suthish NairRank #92 · 22.8K reputationPosted Jan 24, 2011, 8:26 PM EST
0
change you code to..
MessageBox.Show will work for windows only, not web applications.
Code
if (DropDownList1.SelectedItem.Value != null)
{
Response.Write("alert('There is no timetable available for'); window.opener.document.location.href='DownloadTimetable.aspx';")
}
GetCustomMadeDataTable();
GeneratePDF(table);
lauren brown33 reputationPosted Jan 24, 2011, 9:41 PM EST
0
Hi,
Thanks for your reply:)
However, I am unable to get the output. The output stays the same as before.
The user is not suppose to select one of the opetion under the Reminder field. If they accidently select the reminder and click on the "Download PDF" button, the system will prompt user with an message to remind them that "There is no reminder availavle for PDF format".
Thanks ur help is deeply appreciated. Hope to hear from u soon!
0
Sam HobbsRank #107 · 20.5K reputationPosted Jan 25, 2011, 8:29 AM EST
0
Perhaps your question is not clear. You said "there should be a message box" and Suthish explained that the MessageBox class won't work for web pages. Is your application a web page or a desktop application? Also, it is still not clear what you need help with.
What is the "Download PDF" button? Is it in a form that you created; if not, then where does it come from? What is the Reminder field?
Suthish NairRank #92 · 22.8K reputationPosted Jan 24, 2011, 8:26 PM EST
MessageBox.Show will work for windows only, not web applications.
lauren brown33 reputationPosted Jan 24, 2011, 9:41 PM EST
Thanks for your reply:)
However, I am unable to get the output. The output stays the same as before.
The user is not suppose to select one of the opetion under the Reminder field. If they accidently select the reminder and click on the "Download PDF" button, the system will prompt user with an message to remind them that "There is no reminder availavle for PDF format".
Thanks ur help is deeply appreciated. Hope to hear from u soon!
Sam HobbsRank #107 · 20.5K reputationPosted Jan 25, 2011, 8:29 AM EST
What is the "Download PDF" button? Is it in a form that you created; if not, then where does it come from? What is the Reminder field?
Marco de Boer4 reputationPosted Jan 25, 2011, 12:09 PM EST
lauren brown33 reputationPosted Jan 26, 2011, 3:50 PM EST
Bryian TanRank #396 · 6.3K reputationPosted Jan 26, 2011, 5:34 PM EST
How did you solve it?