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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:11:22+00:00 2026-06-14T02:11:22+00:00

I make an ajax request to invoke a controller action like so: Controller: [AsyncTimeout(8000,

  • 0

I make an ajax request to invoke a controller action like so:

Controller:

    [AsyncTimeout(8000, Order = 3)]
    [HandleError(ExceptionType = typeof(TimeoutException), Order = 4, View = "TimeoutError")]
    public async Task<JsonResult> RemovePackageAsync(CancellationToken cancellationToken, string packageId, ICollection<int> ids)
    {
        PackageRemoveItem removeItem = new PackageRemoveItem()

        .............blah blah blah

        await this.deviceRepository.RemovePackageAsync(removeItem);
        return  this.Json(JsonConvert.SerializeObject(removeItem.Machines));
    }

Method:

    public async Task RemovePackageAsync(PackageRemoveItem removeItem, CancellationToken cancelToken = default(CancellationToken))
    {
        await Task.Run(() =>
        {
            int[] machines = removeItem.Machines.Keys.ToArray();
            .......


        });
    }

However, when I run this in debug my ajax response waits until my “RemovePackageAsync” finishes. What I’m trying to achieve here is to have this method be called on a different thread, let it execute and NOT wait for it to finish but to get “true” response right away from the controller.

ajax call => controller => call method on new thread, do NOT wait for it to finish BUT return true => let method run as long as it needs. and I get to do other stuff

  • 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-14T02:11:23+00:00Added an answer on June 14, 2026 at 2:11 am

    Asynchronous controllers work asynchronous just inside the webserver to free threads from the threadpool to handle concurrent requests. The browser still waits synchronous for the result to be returned by your action.

    What you need is a standard controller action which just spawns a thread or a task and returns immediately.

    But that way you can’t return any resulting data.

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

Sidebar

Related Questions

I would like to make an ajax request that still retains access to the
I make an AJAX request like so using JQuery: $.ajax({ type: GET, url: getvideo.php,
With jQuery you can make an ajax request like this: request=$.ajax({ url: test.html, });
I would like to make an Ajax request to the server, which replies a
Simple task like make AJAX request , pass one parameter and return result, can
I use this pseudo-class to make Ajax request to server: function RequestManager(url, params, success,
I make an AJAX request to see if a sesion variable has been set.
I'm trying to make an ajax request recursively upon each success response that is
I try to iterate throug an array of ids and make a ajax request
I'm trying to implement authentication using jquery to make an ajax request to a

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.