We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Return All the files uploaded back the the aspx file into a GridView

Dear All,
I actually save the file name and tag to their unique Id, as 1 id can have several files tagged to it.
I save it into a database table in MS SQL 2012 Express.
I'm wondering how can I inform that .aspx file that the upload is completed, and now I want to trigger the code in .aspx.vb or .aspx.cs code behind to execute a stored procedure to pull out all the uploaded files that's tagged to the current Id, and bind it to Datagrid for display.
I wish to know how the stage changes can be made informed to the code behind file where the uploadbox control was implemented in.
Thanks in advance!
Cheers,
Jenson

4 Replies

ES Ezhil S Syncfusion Team January 5, 2016 11:15 AM UTC

Hi Jenson,

Thank you for contacting Syncfusion support.

Query : how can I inform that .aspx file that the upload is completed.
If you are using client side component Essential Javascript UploadBox control then you can use “complete” event, which will be triggered in the end of uploading all the files. So we suggest you to use complete event and define your function to be performed on upload completion. The complete event argument have the uploaded file name, size, extension and other details.
Refer the following UG and online demo for more details regarding UploadBox events,
http://help.syncfusion.com/js/api/ejuploadbox#events:complete
http://js.syncfusion.com/demos/web/#!/azure/uploadbox/Events
You can check the sample in link below to ensure the behavior:

http://jsplayground.syncfusion.com/vkaiijyp

If you are using Syncfusion ASP.NET Wrapper’s UploadBox control then you can use “OnComplete” server side event. This will directly pass the uploaded files detail to code behind file on a post back using the complete event handler arguments. Please refer the following online demo, http://asp.syncfusion.com/demos/web/uploadbox/events.aspx

Please let us know if you have any other queries.

Regards,
Ezhil S


JC Jenson Chew January 7, 2016 05:46 AM UTC

Dear Ezhil,

Thanks for your response. I'm not using ASP.NET Wrapper, may I know beside using ejGrid, can I use ASP.NET GridView control instead?

Thanks.

Regards,
Jenson


JC Jenson Chew January 7, 2016 10:05 AM UTC

Can I display a list of hyperlinks to the files uploaded, so that user can immediately open and check the files once all of them have been uploaded?


AP Arun Palaniyandi Syncfusion Team January 11, 2016 08:54 AM UTC

Hi Jenson,

Thanks for the update,

Query 1: I'm not using ASP.NET Wrapper, may I know beside using ejGrid, can I use ASP.NET GridView control instead?

Yes, you can use ASP.NET GridView to display the details of the uploaded files. After the file upload is complete, through the ASP hidden field, pass the values to code behind. The values will be the list of JSON strings and the values deserialize.  Then bind the values to the Gridview. Now, complete event argument values like the Filename,size,extension,datemodified will be displayed in the ASP Gridview.

Query 2: Can I display a list of hyperlinks to the files uploaded, so that user can immediately open and check the files once all of them have been uploaded?

This can be achieved by giving the ASP linkbutton column to the Gridview. Once the files are uploaded, the filename with the hyperlink will be displayed as one of the columns, and if the user clicks, the file will be downloaded and opened.

We have prepared a custom sample based on your scenario. You can find it in the following link:
http://www.syncfusion.com/downloads/support/forum/121579/ze/uploadgrid1238109887

Please let us know if you have any other query.

Regards,
Arun P


Loader.
Live Chat Icon For mobile
Up arrow icon