Multiple Ajax Calls.

Multiple Ajax Calls.

Hi All, I have this function that works well:
 
  1. $.dimScreen(1, 0.4, function () {

    $('#dimmer').fadeIn();

         $.ajax({

          type: "POST",

          url: "Default.aspx/Process",

          data: '{Irs: \'' + encodeURI(textArray) + '\',other: \'' + encodeURI      (textArrayOther) + '\'}',

          contentType: 'application/json; charset=utf-8',

           dataType: 'json',

           success: function (response) {

            if (response != null && response.d != null) { alert(response.d); }

            $.dimScreenStop();

            location.reload(); }, /* Clear the screen of any completed files that have been moved */

            error: function (XMLHttpRequest, textStatus, errorThrown) { $.dimScreenStop(); }

         });

    });

  2. However, On the serverside WebMethod I have a process that may be a little while. So once I have Posted the above Ajax Call I want to continue Call another WebMethod to set a progress bars total and then poll another webmethod until the value returned = the amount returned from the previous method. The idea being that I'll be able to somehow set these to a progress bar's value.
    Server side:

    [WebMethod, ScriptMethod(ResponseFormat = ResponseFormat.Json)]

    public static Int32 ProgressSoFar()

    {

    Int32 totProgress = Convert.ToInt32(HttpContext.Current.Session["SessionProgress"]);

    return totProgress;

    }

    [WebMethod, ScriptMethod(ResponseFormat = ResponseFormat.Json)]

    public static Int32 ProgressMax()

    {

    Int32 finalAmount = Convert.ToInt32(HttpContext.Current.Session["SessionProgressTot"]);

    return finalAmount;

    }

    Can someone also point me to a progress bar that I can use;