Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

reportviewer and ModalPopupExtender

$
0
0

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.



Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>