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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:57:46+00:00 2026-05-28T06:57:46+00:00

At the moment, my project has a method do_quote(quoteid,userid) This method take a minute

  • 0

At the moment, my project has a method

do_quote(quoteid,userid)

This method take a minute or two, and then redirects to another page.

This has been rewritten so that it now runs in the background and redirects to another page whilst the thread which do_quote is on continues. – This works fine.

In a button_click event in a default.aspx page :

Dim d as New do_quote_delegate(AddressOf do_quote)
d.BeginInvoke(quoteid,userid, New AsyncCallback(AddressOf Callback),d)
Response.redirect("results.aspx")

Which relates to

Delegate Sub do_quote_delegate(Byval quoteid as integer, Byval userid as integer)

Public Sub do_quote(Byval quoteid as integer, Byval userid as integer)
     ' Do something for several seconds
End Sub

Public Sub Callback(Byval ar As IAsyncResult)
    ar.AsyncState.EndInvoke(ar)
    ' i think i need something here to trigger a notification
End Sub

This basically does what i want, a user can carry on doing things on the site and the do_quote method runs in the background and completes its tasks successfully.

What i would like is to send a notification to the browser when do_quote finishes. Ideally i’d like to change the text of a div on the masterpage(but just returning an ALERT javascript msgbox would be a start).

As far as i understand, Callback is called at the end of the process, so i think this would be an ideal place to send javascript to the browser, but i can’t think how i could implement this. Does anyone have any ideas on how i could implement a very basic notification (msgbox, response.write etc.) to the browser when the Callback method is called at the end of the process? 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-28T06:57:47+00:00Added an answer on May 28, 2026 at 6:57 am

    I think you need to invert control of the process flow since I don’t think that there is any way to push from the web server back to the web browser.

    The general outline for the way that we handle long-running transactions like this is as follows:

    Initiate the process on the web server, either through postback or ajax request.

    The web server generates a unique identifier for the request and fires off a background worker, or a thread, or queues a request in a database table for a service to pickup and process.

    If a background worker or thread is started, the unique identifier for the request is recorded somewhere in the application, usually in a database to ensure that it is available in the case of a web farm or web garden (as opposed to storing it in cache or static variables).

    Once the process is initiated, the web server returns the unique id to the browser.

    The browser then sets up a window.timeout loop to regularly check the status of the request through an ajax call or PageMethod.

    When the process is complete, either success or failure, it updates the status in the location where the unique id was originally recorded (again, usually a database table) along with any error message that may have been generated.

    The next time the client timeout fires, it will discover that the process has completed and can then perform the appropriate actions (navigating to a different page, displaying an error message, etc).

    We have successfully used this pattern for several long running activities including report generation and data merging.

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

Sidebar

Related Questions

I am doing a project at the moment and I need an efficient method
This is a toy project I'm working on at the moment. My app contains
A project I'm working on at the moment involves refactoring a C# Com Object
Working on a project at the moment and we have to implement soft deletion
At the moment I am working on a project admin application in C# 3.5
I'm planning a new project at the moment, built on MVC. Now, there are
I am working on a project at the moment that requires a dialog box
I'm working on a project were we have number (5 at the moment) of
Ok I'm working on a little project at the moment, the Report expects an
I'm starting a new Silverlight project at the moment, and I'm having issues where

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.