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

  • Home
  • SEARCH
  • 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 7936341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:11:04+00:00 2026-06-03T22:11:04+00:00

What I have is an AJAX form on a View that makes a call

  • 0

What I have is an AJAX form on a View that makes a call to the server. This call perform n number of tasks where n is a number decided by records in a database (typically no more than 10 records). Each record corresponds to a Build Definition in TFS so what I am trying to do is get all of these Build Definitions, queue them in TFS, and as each build completes update the UI so that user knows which builds have completed.

Unfortunately I am not sure about how best to do this. I was thinking something along these lines:

        foreach (var dep in builds)
        {
            TFS tfsServer = new TFS(TFS_SERVER_ADDRESS);
            IBuildServer buildServer;
            int id = tfsServer.QueuBuild(dep.TeamProject, dep.BuildDefinition);
            string teamProject = dep.TeamProject;
            Task.Factory.StartNew(() => GetBuildStatus(teamProject, id, tfsServer));

        }

The task that is called is:

        private void GetBuildStatus(string TeamProject, int BuildID, TFS Server)
        {
            Server.GetBuildStatus(TeamProject, BuildID);
            AsyncManager.OutstandingOperations.Decrement();
        }

The problem here is that my Completed method isn’t going to get called until all of the builds have completed. How would I go about feeding data back up to the UI a piece at a time?

It is also worth mentioning that the GetBuildStatus method looks like this:

        do
        {
            var build = buildsView.QueuedBuilds.FirstOrDefault(x => x.Id == BuildID);
            if(build != null)
            {
                status = build.Status;
                detail = build.Build;    
            }

        } while (status != QueueStatus.Completed);
        return detail.Status.ToString();
  • 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-03T22:11:06+00:00Added an answer on June 3, 2026 at 10:11 pm

    Given that the duration of a build will be longer than the timeout for an HTTP request you cannot leave the browser waiting while this happens. You need to return a page and then poll for updates from that page using AJAX. Typically you’d have a timer in javascript that triggers a regular call back to the server to get the updated status information.

    But, since you are using .NET you could also consider trying SignalR which lets you use long polling, server sent events or web sockets to wait for updates from the server and it wraps it all up in some easy to implement .NET classes and Javascript.

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

Sidebar

Related Questions

When I try to make an $ajax->form() call within my view, the server responds
I have an ajax form in asp.net mvc which is as simple as this:
I have an Ajax form that updates a div when submitted with a submit
I have this AJAX submission form written with the jQuery validation plugin. It all
I have an Ajax contact form that links to a jquery file but for
I have a small jQuery plugin that I use for form AJAX validation. There
I have an Ajax form that sends input data to a controller. I currently
I have an MVC view with a form built with the Ajax.BeginForm() helper method,
I have a ajax form that populates select lists with values based on the
I would like to have Ajax form in Rails so i'm using form_remote_tag. The

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.