how to handle long time taking process in

Posted on 2009-02-21
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

    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.
    LVL 8

    Expert Comment

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


    Author Comment

    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
    why can not load the page first and process this task in some other event?
    LVL 15

    Accepted Solution

    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

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    In my previous article ( we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
    Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    728 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

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now