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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:45:47+00:00 2026-06-05T01:45:47+00:00

I have a button and two labels in my aspx page , i would

  • 0

I have a button and two labels in my aspx page , i would like to display text in label and after few seconds i would like to fill second label with different text on button click
My code is
source file

<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
<asp:Label ID="lblFirst" runat="server" Text=""></asp:Label> 
 <asp:Label ID="lblSecond" runat="server" Text=""></asp:Label>
<asp:Button ID="btnFirst" runat="server" Text="First" 
            onclick="btnFirst_Click" />
 </ContentTemplate>
        </asp:UpdatePanel>

and code file

    protected void btnFirst_Click(object sender, EventArgs e)
            {
                first();
                second();
            }
            private void first()
            {
                I am Calling a method form my class file which returns a string , and assigning to label first
//class1 obj=new class1();
//string result=obj.first()
           // lblFirst.Text =result;
            }
            private void second()
            {
                   I am Calling a method form my class file which returns a string , and assigning to label Second
//class2 obj=new class2();
//string result1=obj.Second()             
                lblSecond.Text = result1;
            }

I am getting two responses, i would like to display which i got first without waiting for second response and after getting second response should display immediately without loosing first response, pls give me any suggestion urgent ,
Is there any other procedure to get such a output

Thanks
hemanth

  • 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-05T01:45:49+00:00Added an answer on June 5, 2026 at 1:45 am

    You can’t make a delay like that in the server code. The page is not sent to the browser until the server code has rendered it, and that happens after the control events. The code will just wait for seven seconds, then render the page and send it to the browser.

    You have to use client side code to get the experience that you are after. The server can’t push changes to the web page after it has been sent to the browser.

    protected void btnFirst_Click(object sender, EventArgs e) {
      string code =
        "window.setTimeout(function(){document.getElementById('" + lblFirst.ClientID + "').innerHTML='first filled'},1000);"+
        "window.setTimeout(function(){document.getElementById('" + lblSecond.ClientId + "').innerHTML='Second filled'},7000);";
      Page.ClientScript.RegisterStartupScript(this.GetType(), "messages", code, true);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASPX page with two RequiredFieldValidator and a button to go to
I have Six labels, I want to hide two label's text randomly when a
Using jQuery UI I have two radio buttons, Approve/Reject, which I would like to
I would like to make a custom button, that will display 3 data bound
I have a Gridview I have Click Button and two labels. (Risk_label and MV_label)
I have a master page that has two content sections like this (left some
I have two button name A, and B want to click them equal to
I have two validation groups: parent and child I have an add button that
I have two fields which calculate a total, but I have a radio button
I have two array and three button in segment control i want that when

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.