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 3613926
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:11:05+00:00 2026-05-18T22:11:05+00:00

in my ASP.NET MVC3 Project, I’ve got an action which runs a certain amount

  • 0

in my ASP.NET MVC3 Project, I’ve got an action which runs a certain amount of time.
It would be nice, if it could send partial responses back to the view.
The goal would be to show the user some progress-information.
Has anybody a clue how to make that work?

I did a try with some direct output to the response, but it’s not being sent to the client in parts but all on one block:

[HttpPost]
public string DoTimeConsumingThings(int someId)
{
   for (int i = 0; i < 10; i++)
   {
      this.Response.Write(i.ToString());
      this.Response.Flush();
      Thread.Sleep(500); // Simulate time-consuming action
   }
   return "Done";
}

In the view:

@Ajax.ActionLink("TestLink", "Create", new AjaxOptions() 
  { HttpMethod = "POST", UpdateTargetId="ProgressTarget" })<br />

<div id="ProgressTarget"></div>

Can anybody help me making progressive action-results?
Thanks!!

  • 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-05-18T22:11:06+00:00Added an answer on May 18, 2026 at 10:11 pm

    Here’s how you could implement this: start by defining some class which will hold the state of the long running operation -> you will need properties such as the id, progress, result, … Then you will need two controller actions: one which will start the task and another one which will return the progress. The Start action will spawn a new thread to execute the long running operation and return immediately. Once a task is started you could store the state of this operation into some common storage such as the Application given the task id.

    The second controller action would be passed the task id and it will query the Application to fetch the progress of the given task. During that time the background thread will execute and every time it progresses it will update the progress of the task in the Application.

    The last part is the client: you could poll the progress controller action at regular intervals using AJAX and update the progress.

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

Sidebar

Related Questions

I have an ASP.NET MVC3 project that uses a tab strip on certain pages.
We've got an ASP.NET MVC 3 project that uses single action controllers , and
I've got an ASP.NET MVC 3 project which works with jQuery. At some point
I am working on a project which adopted ASP.NET MVC3(Razor) tech. Now, I have
I'm working on a rather large Asp.net MVC3 project and would like to use
I have an asp.net mvc3 project, it has some reports in aspx web pages.
I'm programming an ASP.NET MVC3 project, and I am required to implement user authentication
I noticed that when I installed StructureMap from NuGet into my ASP.NET MVC3 project,
At the moment I have a MasterPage in an ASP.NET MVC3 project with a
I use Windows 7, ASP.NET MVC3 and IIS 7.5. When i debug MVC project,

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.