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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:48:39+00:00 2026-05-13T10:48:39+00:00

Here is the situation. I need to hit ~50 servers and grab some data

  • 0

Here is the situation. I need to hit ~50 servers and grab some data from a file. I then want to display a few rows for each in an ASP.NET GridView control.

I tried doing this with Threads/ThreadPool and successfully gather all the data in session.

What I’d like to do, and what I am having a hard time figuring out, is update the grid for the user after each server is done loading.

If I put the databinding code in the thread, it will only display whatever has loaded by the time the response is sent back to the client. If I take it out of the thread, I’d have to wait until all threads were done to send the response, and that doesn’t do what I want.

Anyone have any ideas? I seeing some stuff about Asynchronous Client Callbacks, but I’m not sure if that’s what I need to be using. I have no idea how to manipulate a GridView from Javascript.

Thanks for any help you can provide.

  • 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-13T10:48:39+00:00Added an answer on May 13, 2026 at 10:48 am

    There’s no way for the server side ASP.NET code to poke the web browser and to tell it that there’s new data available. So you’ll have to use to JavaScript to poll the server for new data. There are various ways of doing this. One example would be to use Page Methods on the server side that could tell the client whether there’s more data available and when all the data has been loaded.

    [WebMethod]
    public static bool IsNewDataAvailable(int currentClientRows)
    {
        return dataCollectedSoFar.Count > currentClientRows;
    }
    
    [WebMethod]
    public static bool IsFinished()
    {
        // return true if all the threads in the thread pool are finished
    }
    

    You need to call the IsNewDataAvailable method at regular intervals. A simple JavaScript timer should do the trick.

    When there is new data available, you’ll need to re-render the GridView. Again, there’s more than one way to do this, but a nice and simple way would be to put the GridView inside an UpdatePanel along side a Button with a style=”display: none;” attribute to keep it hidden. Then if there is new data available, simply call the JavaScript click method on the button to update the contents of the update panel.

    <script>
    var timerId = setInterval("checkForData()", 5000);
    
    function checkForData() {
    
        // If all threads have finished, stop polling
        if (PageMethods.IsFinished()) {
            clearInterval(timerId);
        }
    
        var currentRowCount = 0;
    
        // Find out how many rows you currently have, if 
        // you have jQuery you could do something like this
        currentRowCount = $("#<%= myGridView.ClientID %> tr").length;
    
        if (PageMethods.IsNewDataAvailable(currentRowCount)) {
    
            // Here we trigger the hidden button's click method, again
            // using a bit of jQuery to show how it might be done
            $("#<%= myHiddenButton.ClientID %>").click();
        }
    }
    </script>
    
    . . .
    
    <asp:UpdatePanel ID="myUpdatePanel" runat="server">
        <ContentTemplate>
            <asp:GridView ID="myGridView" runat="server">
                . . .
            </asp:GridView>
            <asp:Button ID="myHiddenButton" runat="server" style="display: none;" OnClientClick="myHiddenButton_Click" />
        </ContentTemplate>
    </asp:UpdatePanel>
    

    Finally, to populate the GridView on the server side, you can continue to use a ThreadPool and just render all the data you have each time. For example:

    protected void myHiddenButton_Click(object sender, EventArgs e)
    {
        myGridView.DataSource = dataCollectedSoFar;
        myGridView.DataBind();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 266k
  • Answers 266k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You must use sc.exe. Visit http://support.microsoft.com/kb/251192 for the details. Then… May 13, 2026 at 12:45 pm
  • Editorial Team
    Editorial Team added an answer A page is a minimal physical data unit SQL Server… May 13, 2026 at 12:45 pm
  • Editorial Team
    Editorial Team added an answer Security: leaving memory alone would leak information from other processes… May 13, 2026 at 12:45 pm

Related Questions

Here is the situation for which I am trying to find a suitable design.
Here is the situation : If I am in page-1 now I am clicking
Hopefully somebody can help me out here. I'm working within an embedded ActionScript2 and
Okay, here's the situation: We have a table of about 50 columns (created by
I have an application that's a mix of Java and C++ on Solaris. The

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.