Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
5368
WebUpload server events
posted

So far, I like the WebUpload control.  Very sharp.

I want to allow the user to upload an Excel file, use the Infragistics.Documents.Excel library to read the file, and then display the first worksheet in a WebDataGrid.

The file is uploading correctly to the Uploads folder, and I have code in the but the server-side WebUpload1_UploadFinished event, but no postback occurs when the upload completes.  The server-side events appear to not be firing at all.

Am I missing something fundamental here?  I can't find any documentation on the server events.

Also, it would be super if the "saving to disk" step could be avoided altogether, and just pass the filestream as an argument to the UploadFinished event.  That would be ideal.

Parents
  • 1800
    posted

    Hi Rob,

    First please confirm that you are using jquery for ASP.net(I am just asking this question so I could be more helpful in your concrete situation). Also event UploadFinished is fired when the upload is finished and the file is uploaded as you know. Meantime probably the page is already sent from the server to the client and loaded. So my advice is to attach to client-side event fileUploaded and to make request to the server to get information about first worksheet(or you want). Server-side event UploadFinished you can use to analyze and process information from the excel file (e.g. using Infragistics.Documents.Excel library) and to return to the client in format as you want(usually JSON). One possible solution is to save this information into the session (it depends of how big the information is, what exactly the load is). I just give you an example how you can achieve this task.As this process(for processing and analyzing the information from the excel file) can take some time you can make request(to get server-side information for the first worksheet) after some timeout. For instance in the event handler for client-side event - "fileUploaded" you can make request after some time interval - e.g. 1000 miliseconds.  If the file is not processed yet the server can return some error status and this request could be make after another time interval - 500 ms for instance. Of course you should have implemented logic in your server which returns this information.

    I hope this information will be helpful for you.

     

    Thanks for using our controls,

    Miro Hristov

Reply Children