Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7758349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:20:13+00:00 2026-06-01T13:20:13+00:00

I have to do some processing on a file loaded by the user. This

  • 0

I have to do some processing on a file loaded by the user. This process can take a long time based on the number of pages within the file. I am planning on using jQuery UIs progressbar and telling the user how many pages have been processed. However, my progress check does not return until the first ajax call is complete. Both calls complete properly are connecting to the corresponding web methods.

I researched this a little bit already, and I found this answer to another question which pretty much stated that if both calls use the Session they wont process concurrently. I only use the Session in one of the calls though.

What am I missing?

This is the initial call that starts the processing of the file. I set the UpdateProgressBar to run a second after the processing of the file starts.

setTimeout("UpdateProgressBar();", 1000);

$.ajax({
    type: "POST",
    async: true,
    data: // my params go here
    url: // path to web method
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function (result) {
         // Do stuff when file is finished processing
    },
    error: function (XMLHttpRequest, textStatus, errorThrown) {
        if (errorThrown != null)
            alert(textStatus + " : " + errorThrown);
    }
});

This is the UpdateProgressBar function:

function UpdateProgressBar() {
    $.ajax({
        type: "POST",
        async: true,
        data: // my params go here
        url: // path to web method
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (result) {
            var totalPages = parseInt($('[id$=lbl_PageCount]').text());
            var pagesProcessed = result.d;
            var percentProcessed = pagesProcessed / totalPages;

            $('#div_ProgressBar').progressbar("value", percentProcessed);

            if (pagesProcessed < totalPages)
                setTimeout("UpdateProgressBar();", 800);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            if (errorThrown != null)
                alert(textStatus + " : " + errorThrown);
        }
    });

Edit:

This is the WebMethod called by UpdateProgressBar. The other WebMethod does use Session, but as you can see this one does not. They both access a dll, however, I tried testing without using the dll for the update and it did not make a difference.

[WebMethod]
public static int CheckPDFProcessingProgress(// params go here)
{
    int pagesProcessed = 1;

    try
    {
        OrderService _orderService = new OrderService();
        pagesProcessed = _orderService.GetMailingPDFPagesProcessedProgress(PersonID);
    }
    catch (Exception ex)
    {
        // log error
    }

    return pagesProcessed;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T13:20:15+00:00Added an answer on June 1, 2026 at 1:20 pm

    Through a little research, I was able to discover two ways to get around my problem. The main issue was Session related, however, I was not explicitly using the Session which is why it eluded me for so long.

    ASP.NET pages think that they use the Session by default even if you do not use it manually. Therefore, in order for your Web Methods to behave concurrently you have to explicitly tell the WebMethods that they do not use the Session like this:

    [WebMethod(EnableSession=false)]
    

    Or if you are going to have many WebMethods and are going to store them all on one page you can set the page directive to not use Session like so:

    <%@ Page Async="true" EnableSessionState="False" %>
    

    Thanks for all the help everyone!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to copy and do some simple processing on file. I can not
i have some web based application that creates a zip file when user asks
I have small utility that does some processing on a file and changes the
I am processing some CSV file which i have copied in Bin folder of
Scenario I have a windows service written in C# that performs some processing based
I have some service which does some file processing. It may need to map
I have a class A which reads an XML file and does some processing.
So I have some cool Image Processing algorithm. I have written it in OCaml.
I have some command-line ruby scripts for things like pre-processing text files before uploading
I have some code as shown below: - (IBAction)startButtonPressed:(id)sender { statusText.text = @Processing...; //here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.