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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T05:45:07+00:00 2026-05-21T05:45:07+00:00

I have a TextBox inside my .Aspx page: <ajax:UpdatePanel ID=UpdatePanel2 runat=server> <ContentTemplate> <asp:TextBox ID=txtCity

  • 0

I have a TextBox inside my .Aspx page:

<ajax:UpdatePanel ID="UpdatePanel2" runat="server">
    <ContentTemplate>
        <asp:TextBox ID="txtCity" AutoPostBack="true" OnTextChanged="txtCity_TextChanged"
            Width="90%" runat="server" ></asp:TextBox>
    </ContentTemplate>
</ajax:UpdatePanel>

Code behind:

protected void txtCity_TextChanged(object sender, EventArgs e)
{
    lblMessage.Text = "you have typed:" + txtCity.Text;
}

And for lblMessage [on the same .Aspx page]:

<ajax:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
        <asp:Label ID="lblMessage" runat="server" Text="" ></asp:Label>
    </ContentTemplate>
</ajax:UpdatePanel>

But when I am typing in the TextBox. lblMessage is not updating.

How to rectify this?

  • 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-21T05:45:07+00:00Added an answer on May 21, 2026 at 5:45 am

    It sounds like you’re thinking that the OnTextChange event is fired while you are typing in the text box. This is not true. OnTextChange is a server-side event and only fires when the page (or panel) is posted back. Typing into a text box on a page does not post the page back and so this event will only fire once you submit the form.

    What you would actually want to do in this case, is to use some JavaScript with the onkeypress JavaScript event to update the label text as things are typed into the TextBox. JavaScript is run on the client and doesn’t require you to post back the page in order for it to run.

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

Sidebar

Related Questions

I have a textbox inside the update panel.. <asp:UpdatePanel ID=UpdatePanel1 runat=server UpdateMode=Always> <ContentTemplate> <asp:TextBox
I have this code on an aspx page. <asp:DropDownList runat=server ID=ddlSize CssClass=textbox Width=100px> <asp:ListItem
I have a asp:textbox inside an AJAX updatepanel. My goal is to be able
I have this inside a usercontrol in my aspx: <asp:TextBox TextMode=MultiLine onkeydown=textCounterLatest('<%=txtContent.ClientID%>' , '<%=remLen.ClientID
i have 2 textbox controls inside a usercontrol TextBoxUC.ascx i have a page.aspx that
I have a TextBox inside an asp.net UpdatePanel that records the number of key
In asp.net website, inside .aspx i have following code <script type=text/javascript> function callme(option) {
I have a TwoWay data-bound textbox inside my page. I want to do something
Inside of an asp.net mvc partial view, I have an Ajax form that posts
I have an ASP.NET databound textbox inside a FormView, which I want to display

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.