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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:04:27+00:00 2026-05-31T09:04:27+00:00

I Have Label And Button In One UpdatePanel ,Now I call Long Process with

  • 0

I Have Label And Button In One UpdatePanel ,Now I call Long Process with ForEach Loop On Button Click What I want is to Update Text Of Label after Completion Of Loop.Is there any Easy Way to Change Text Of Label At runtime.I heard Something that we can do this with Iframe But I dont have any idea about that.

CODE

aspx

    <asp:UpdatePanel ID="UpdatePanelUpdate" runat="server" UpdateMode="Conditional">     <ContentTemplate>
    <div>
    <asp:Button ID="ButtonUpdate" runat="server" Text="Update" 
        onclick="ButtonUpdate_Click" />
    <br />
    <br />
   <asp:Label ID="LabelUpdateCount" runat="server" Text=""></asp:Label>
    < /div>
   </ContentTemplate>

   </asp:UpdatePanel>

aspx.cs

    protected void ButtonUpdate_Click(object sender, EventArgs e)
{
     int count = 0;
    foreach()
    {
        do my stuff();
        count = count + 1;
        LabelUpdateCount.Text = count.ToString();


    }
}

SO,I want to show change of label at runtime…..

  • 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-31T09:04:28+00:00Added an answer on May 31, 2026 at 9:04 am

    If I get it right, the server returns only after the method is completed but you want the client side label to display the current completed item count while it’s being done.

    I would like to mentions an issue with it. Each post back will take roughly around 200-400ms so it won’t be updated any sooner. I strongly suggest consider updating every once in a while than trying to update for every job completed.

    To accomplish this you have to run your function loop on a different thread (have it modify a variable). Add have the client check its status using js timer(return the value of the variable).

    In other words what you are trying to do is to show progress to the client. In which case the following link might be useful.

    Real-Time Progress Bar With ASP.NET AJAX

    Note: it returns percentage. You can change it such a way to have it return the count.

    The above link is taken from the below question. It is in many ways related issue.

    ASP.NET AJAX Progress Bar: Update from Code Behind?

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

Sidebar

Related Questions

i have one label out of update panel and one button inside update panel.
I have a tkinter window with one button and one text label. When the
This is my problem, I have one textbox, one button and one label. Everything
I have three button named(titled) hello, nothing, heaven and one label (IBOutlet UIlabel lab).
i have a label and button inside update panel, when i try to get
I have a button, the label of which I want to change back and
I have a user control that contains multiple controls (CheckBox, Button, Label...). I want
I have to add one image, one label and one button in each cell.
I have one UILabel and one button under the label. Height of the label
I have one MainWindow.xib file. I have one label and one button on first

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.