[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


how to handle long time taking process in asp.net

Posted on 2009-02-21
Medium Priority
Last Modified: 2013-12-17
one of my web page take around 30 to 50 seconds to get completed.
right now user has to wait this much time to view the complete web page.
I am using Ajax and all but this also gives me timeout error very frequently, and this is not very good from end user point of view.

Is there any way that the page keeps loading and user does have to wait that much time,  I am showing loading image but this image also get hanged while the process runs.

Please give some examples that would help me a lot.
Question by:ziorrinfotech
LVL 15

Expert Comment

ID: 23703403
What exactly are you doing that takes up to 50 seconds to complete?  There may be a better way to do it.

You can increase the timeout of your app in the web.config file under the <httpRuntime> section to prevent timeouts.

You can also use javascript to display div layers when the submit button is pressed, so you can display a "Loading" image or something.

Expert Comment

ID: 23703413
Add Async="true" attribute on the page directive of the page.


Author Comment

ID: 23703676
I have a dataset which contains 12 tables and these tables contains tons of records, and i am inserting these records into the database.
this process takes much time
LVL 15

Expert Comment

by:Praveen Venu
ID: 23703841
why can not load the page first and process this task in some other event?
LVL 15

Accepted Solution

aibusinesssolutions earned 750 total points
ID: 23703866
You could create a separate thread to run the task in,  or set type async=true like bedanand mentioned, but then you wouldn't get any sort of UI notification of the task completion, unless you have it send an email, or update a database table with a "status" for the task.

I've seen some pages do that, where it just refreshes the page every 5 seconds or so, and shows the status of the job from a job queue.

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month19 days, 11 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question