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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:08:33+00:00 2026-06-11T15:08:33+00:00

I have an asp.net website which contains a Thread that fetches some data from

  • 0

I have an asp.net website which contains a Thread that fetches some data from a WCF service. That thread runs in an infinite loop waiting each run for 1 second. Now I would like to show the stuff it got from the WCF service in a label. I added that label to an UpdatePanel and invoked the .Update() method. I don’t get any exceptions, however, the label does not update at all. Here is my code (simplified):

t = new Thread(new ThreadStart(() =>
{
   while (true)
   {
      Label1.Text = GetFromWCF() + " " + DateTime.Now.ToString();
      updatePanel.Update();
      Thread.Sleep(1000);
   }
}
));

t.IsBackground = true;
t.Start();

This code is in the OnInit Method of the page. The updatePanel looks like this:

<asp:ScriptManager runat="server" ID="scriptManager" EnablePartialRendering="true"/>
<asp:UpdatePanel runat="server" ID="updatePanel" UpdateMode="Conditional">
   <ContentTemplate>
      <asp:Label ID="Label1" runat="server" />
   </ContentTemplate>
</asp:UpdatePanel>

Am I missing anything? Maybe I should also inform you that I am very new to asp.net.

  • 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-11T15:08:35+00:00Added an answer on June 11, 2026 at 3:08 pm

    You are not fully understand the way that Ajax and UpdatePanel work.

    Actually the UpdatePanel, from the client side, ask from the server data by making a post request and then waits to get them, after is get the data is update the client. The browser must make the request to get data – the server can not send to the browser any data, with out first browser ask for them.

    The command updatePanel.Update(); have the meaning to notify the UpdatePanel that there is an update, on code behind after the post – and is not working like you think, is not send data to the UpdatePanel just because you call it.

    Even if you make a close loop like that after the post, the UpdatePanel is wait the connection to fully complete and close to display the data, so a loop in a thread like that can not make a connection to send data.

    To make your idea work, ether create a timer on client side that ask for the data every some time, ether thing the comet technique : Reverse AJAX with IIS/ASP.NET

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

Sidebar

Related Questions

I have an asp.net website which contains a few pages that I'd like to
I have a server which already host ASP.Net website. I am migrating from blogger
Suppose I have an ASP.NET website running with its corresponding web.config file, which contains
I have an existing ASP.NET website with some custom routing, within a Solution that
I have a ASP.NET website which contains a Google Map. I am using the
We have in the company a asp.net website which has a pages that depends
I have an company asp.net website with textboxes which may contain several hundred words.
I have an ASP.Net website which has a remember me feature for Login page.
I have developed an ASP.Net (VB.Net) website which is using Entity Framework and SQL
I have an asp.net website in my production server which running fine now. Now

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.