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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:30:29+00:00 2026-05-31T22:30:29+00:00

I have a ASP.NET MVC3 application that handles time-consuming processes (copying a large file

  • 0

I have a ASP.NET MVC3 application that handles time-consuming processes (copying a large file from network). What we want to do is:

  1. User clicks a button to post the form to trigger the process
  2. Application starts a new thread to start copying the file
  3. Application shows a message saying the file-copying process has begun
  4. User can close the browser while the copying processed and finished in the background.

The idea is that the user doesn’t need any confirmation on the progress of the process, nor be notified when the process has completed.

We currently let the controller trigger an event in a Windows Service, and use the Windows Service to do the actual work. I’m wondering if there’s a better/cleaner way to do this?

  • 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-31T22:30:31+00:00Added an answer on May 31, 2026 at 10:30 pm

    You could use System.Threading.Tasks.Task calling the StartNew method with an Action delegate.

    Using those tools your controller would look something like this:

    [HttpPost]
    public ActionResult DoSomethingLongRunning()
    {
       if (ModelState.IsValid)
       {
           Task.Factory.StartNew(() => 
                       fileCopier.CopyFile(CopyFileParameter1, CopyFileParameter2));
    
           return RedirectToAction("View Indicating Long Running Progress");
       }
       else
       {
            // there is something wrong with the Post, handle it
            return View("Post fallback view");
       }
    }
    

    Another option is you could use System.Reactive.Concurrency and the IScheduler interface with TaskPoolScheduler as the concrete implementation to perform the action (possibly injected in the controller constructor.

    public ActionResult DoSomethingLongRunning()
    {
       if (ModelState.IsValid)
       {
           ISchedulerImplementation.Schedule(new Action(() =>
            {
                fileCopier.CopyFile(CopyFileParameter1, CopyFileParameter2);
            }));
            return RedirectToAction("View Indicating Long Running Progress");
       }
       else
       {
            // there is something wrong with the Post, handle it
            return View("Post fallback view");
       }
    }
    

    As a benefit, if you do it this way you can use TestScheduler as the implementation of the interface when you are unit testing.

    • 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 application that makes Ajax calls to the server on
I have develop small Asp.net MVC3 application using Telerik rad Controls with in that
I have troubles consuming unity container in ASP.NET MVC3 application. I have several project
I am researching security frameworks for an ASP.NET MVC3 application that would have some
In an ASP.NET MVC3 application I have a function that looks like: Public Sub
In my ASP.NET MVC3 application I have the following method that use EF entities
I have to develop an ASP.NET MVC3 application in C# and Razor that has
My application is in Asp.Net MVC3 coded in C#.Net. I have Views which contains
I noticed that when I installed StructureMap from NuGet into my ASP.NET MVC3 project,
I have an ASP.NET MVC 3 application. I need to implement a file uploader

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.