Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
I have a requirement to add a progress bar to my ASP.Net application and am stuck on how to go about achieving this. I have searched many examples and none quite cover what I am trying to do or my ignorance hinders me.

Basically, I am just reading an .xlsx file and handling the data as needed. What I need is a way to track the progress of how many records have been read and update the progress bar accordingly.

Examples I have read include using web services, AJAX, jQuery, Web methods, etc. I feel that I am missing some basic understanding of what I need to do and can't pull all the pieces together.

I am just looking for ideas or suggestions and would appreciate any.

Thank you.
Posted
Comments
ZurdoDev 17-Feb-14 13:37pm    
Because the web is a disconnected medium you have to use somethig like AJAX/jQuery. I would think there are jquery plugins that allow you to specify the values for where you are at. But, you'll need to process your xlsx file through jQuery so that you have control still from the client side. If you are processing as part of a full postback then you won't have any client side control to show the progress bar.
Richard C Bishop 17-Feb-14 13:45pm    
That makes sense, thank you. Do you happen to have a link or article on how to read an excel file with jQuery?
ZurdoDev 17-Feb-14 13:50pm    
I don't. But what are you doing with it? Essentially, if you already have the code in C# can you break it out into section? Meaning 100 rows at time, or something like that? Then you can call a webservice over and over and move your C# into the webservice. Or, what may be easier is to write your progress to a database table and then use jquery's .ajax() method and the settimeout method in JavaScript to call a webservice every 10 seconds to get the current status.
Richard C Bishop 17-Feb-14 14:56pm    
I think I will try the latter. Thank you for the input.
ZurdoDev 17-Feb-14 15:03pm    
Make sure you dot not enable the session in your webservice (it's an attribute on the webmethod [WebMethod( EnableSession=false)] because I have seen that when you enable the session and want to do async calls it really does not do them asynch.

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900