Hi:
I hope to use modalpopupextender to show something when the system is invoking
reportviewer, since it may need several minutes.
the following is my codes:
private delegate List<DBData> AsyncReportDataDelegate(string month); private AsyncReportDataDelegate longRunningMethod; private List<DBData> reportData; protected void button1_Click(object sender, EventArgs e) { longRunningMethod = GetPatientExport; ModalPopupExtender1.Show(); PageAsyncTask task = new PageAsyncTask( new BeginEventHandler(BeginAsyncOperation), new EndEventHandler(EndAsyncOperation), null, null ); RegisterAsyncTask(task); } IAsyncResult BeginAsyncOperation(object sender, EventArgs e, AsyncCallback cb, object state) { return longRunningMethod.BeginInvoke("2013/01", cb, state); } void EndAsyncOperation(IAsyncResult ar) { reportData = longRunningMethod.EndInvoke(ar); ReportViewer1.LocalReport.Refresh(); ModalPopupExtender1.Hide(); }
however, it fails. The ReportViewer1 can not be refresh() at EndAsyncOperation state, furthermore, ModalPopupExtender1.Show()
not working at initial, it will be done after EndAsyncOperation state. That means the asynchrous call is fails.
Is there any other method to implemenet that, thanks a lot.