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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:41:44+00:00 2026-05-24T13:41:44+00:00

In ASP.NET MVC when you create an async action with it’s completed action does

  • 0

In ASP.NET MVC when you create an async action with it’s completed action does it automatically get processed asynchronously?

Example:

If I were to have a single long running task without declaring a delegate does the async void automatically run in a background thread?

   public void NewsAsync(string city) {

    AsyncManager.OutstandingOperations.Increment();
    NewsService newsService = new NewsService();
    AsyncManager.Parameters["headlines"] = newsService.GetHeadlines;
    AsyncManager.OutstandingOperations.Decrement();
}

Or will it only do so if the long running task is an asynchronous task?

   public void NewsAsync(string city) {

    AsyncManager.OutstandingOperations.Increment();
    NewsService newsService = new NewsService();
    newsService.GetHeadlinesCompleted += (sender, e) =>
    {
        AsyncManager.Parameters["headlines"] = e.Value;
        AsyncManager.OutstandingOperations.Decrement();
    };
    newsService.GetHeadlinesAsync(city);
}

so in other words, I do not care if the method inside the void is async but I do care if the void it’s self is async so as to free up IIS threads.

  • 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-24T13:41:45+00:00Added an answer on May 24, 2026 at 1:41 pm

    Your first code example doesn’t make sense. The NewsAsync must return as fast as possible and delegate the work to some background thread. It is the NewsCompleted action that will pass the results to the view as in your second example.

    As far as those background threads are concerned it will depend on how is this NewsService.GetHeadlinesCompleted method implemented. The best possible scenario for async controllers is having some long running I/O operations (such as web service calls, database queries, …) which could be run using I/O Completion Ports. In this situation there is no thread being monopolized during the execution of the request. In other situations such as trying to execute synchronous operations asynchronously (which is what seems to me that you are trying in your first code example) the benefit of asynchronous controllers is very doubtful, could even make things worse.

    For deeper understanding of asynchronous operations in ASP.NET I would recommend you the following article on MSDN. It discusses asynchronous pages but exactly the same notions apply for ASP.NET asynchronous controllers as internally they are implemented as asynchronous handlers (using the IHttpAsyncHandler interface).

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

Sidebar

Related Questions

Does ASP.NET MVC provide a standard validator functionality or do you have to create
I have to create and return file in my aplication ASP.net MVC aplication. The
I have 3 days to learn the basics of ASP.NET MVC and create a
I am about to create an ASP.NET MVC app which will have over 2000
I have planned to create the mobile site using ASP.NET MVC. So, there is
On ASP.NET MVC, I try to write an async Controller action with the old
In my asp.net mvc page I create a link that renders as followed: http://localhost:3035/Formula/OverView?colorId=349405&paintCode=744&name=BRILLANT%20SILVER&formulaId=570230
what is the preferred practice when linq2sql using (in asp.net mvc applications): to create
In ASP.NET MVC, how can I create a single cookie and save multplie values
In ASP.NET MVC, I'm trying to create a link that includes an anchor tag

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.