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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:40:35+00:00 2026-06-17T17:40:35+00:00

I have a asp.net web application, and in a form i use async process.

  • 0

I have a asp.net web application, and in a form i use async process.

Task.Run(async () =>
            {
                foreach (ListItem item in cbListFaculties.Items)
                {
                    if (item.Selected)
                    {
                        service.FinishSyncDepartment(actionId, item.Value);
                    }
                }
            });

But what i want to do is, if the Task has started and user hits that page again, i want to say, that task hasn’t stop yet, so you can’t continue.

How can i resolve this issue? Any idea?

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-06-17T17:40:36+00:00Added an answer on June 17, 2026 at 5:40 pm

    You can create Task object(instead of running it at once) and use IsCompleted property to check if it was completed. Or you can use some thread safe object (static field) to flag that task is busy.

    If you need the task to survive during page reloads – than you’ll have to save reference to that Task object in some manner(cookie, session, static variable, viewstate, cache, database….)

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

Sidebar

Related Questions

I have simple web application (asp.net - ajax) I have a web form which
I am creating a web application in asp.net 4.0 I have a web-form in
I have a asp.net web application that uses C#. It logs in on a
I have an ASP.NET web application the entire site is browsed over HTTPS using
I have an asp.net web application written in C# using a SQL Server 2008
We have an ASP.NET web application hosted by a web farm of many instances
I have a ASP.NET web application which has more than 100 pages. Each page
I have an ASP.NET web application and I want to be able to take
I have a asp.net web application and I'm using cache (HttpRuntime.Cache) to save some
I have an ASP.NET web application that is using forms authentication. Everything is configured

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.