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 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

Related Questions

I'm in a somehow tough situation here. I need to load data from multiple
here is the situation: I need to send a data to a neighbor(socket) and
Here is my situation: I need to preload 2000 images and display them in
I've a rare situation here and I need some ideas, I just prove a
I have the following strange situation here I need some help with: I am
I have a puzzling situation I need some help with here please. I am
Here is my situation. I need to create a report that shows each open
I have an situation here that looks very like a SELECT N+1 from the
I got a little confusing situation here when I use the Context from django.template.
Here is the situation. I have received a WSDL (and included XSD) from someone

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.