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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:48:00+00:00 2026-06-18T01:48:00+00:00

I have an UpdatePanel with a GridView. This GridView has a template column that

  • 0

I have an UpdatePanel with a GridView. This GridView has a template column that is a textbox. The problem is that the textchange event does not fire for the textbox.

Where am I wrong?

Here is the code:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="updatepanelgridview.WebForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <asp:ScriptManager ID="scrManager" runat="server"> 
</asp:ScriptManager> 
<asp:UpdatePanel ID="updPnl" runat="server"> 
<ContentTemplate> 
<asp:GridView ID="grdNumber" runat="server"> 
<Columns> 
<asp:TemplateField> 
<ItemTemplate> 

<asp:TextBox ID="txtNumber" runat="server" OnTextChanged="TextBox1_TextChanged"  AutoPostBack="true"></asp:TextBox>
</ItemTemplate> 
</asp:TemplateField> 
</Columns> 

<Columns> 
<asp:TemplateField> 
<ItemTemplate> 
<asp:DropDownList ID="ddlNumber" runat="server" OnSelectedIndexChanged="ddlNumber_SelectedIndexChanged" AutoPostBack="true" > 

<asp:ListItem>One</asp:ListItem> 
<asp:ListItem>Two</asp:ListItem> 
<asp:ListItem>Three</asp:ListItem> 
<asp:ListItem>For</asp:ListItem> 
</asp:DropDownList> 

</ItemTemplate> 
</asp:TemplateField> 
</Columns> 
</asp:GridView> 
</ContentTemplate> 
</asp:UpdatePanel> 

    </div>
    </form>
</body>
</html>

And here is the codebehind:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
namespace updatepanelgridview
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataTable dt = new DataTable();
                dt.Rows.Add();
                dt.Rows.Add();
                dt.Rows.Add();
                dt.Rows.Add();

                grdNumber.DataSource = dt;
                grdNumber.DataBind();
            }
        }

        protected void ddlNumber_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        protected void TextBox1_TextChanged(object sender, EventArgs e)
        {

        }
    }
}

Here i use dropdownlist in second column which works proper but my textbox textchange event not getting fir please suggest what i am doing wrong?

  • 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-18T01:48:02+00:00Added an answer on June 18, 2026 at 1:48 am

    Set the update mode property of update panel to Always.

    <asp:UpdatePanel ID="updPnl" runat="server" UpdateMode="Always">
    

    In the code behind file under TextBox1_TextChanged event, you can get the latest value using sender.text property.

    If you set updateMode to conditional, in that case you need to add Triggers.

    ——————— This is the code I tried and its working——————

    <%@ Page Title="About Us" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
        CodeFile="About.aspx.cs" Inherits="About" %>
    
    <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    </asp:Content>
    <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
        <div>
            <asp:ScriptManager ID="scrManager" runat="server">
            </asp:ScriptManager>
            <asp:UpdatePanel ID="updPnl" runat="server" >
    
                <ContentTemplate>
                    <asp:GridView ID="grdNumber" runat="server">
                        <Columns>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:TextBox ID="txtNumber" runat="server" OnTextChanged="TextBox1_TextChanged" AutoPostBack="true"></asp:TextBox>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <Columns>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:DropDownList ID="ddlNumber" runat="server" OnSelectedIndexChanged="ddlNumber_SelectedIndexChanged"
                                        AutoPostBack="true">
                                        <asp:ListItem>One</asp:ListItem>
                                        <asp:ListItem>Two</asp:ListItem>
                                        <asp:ListItem>Three</asp:ListItem>
                                        <asp:ListItem>For</asp:ListItem>
                                    </asp:DropDownList>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    </asp:Content>
    


    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Data;
    
    public partial class About : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataTable dt = new DataTable();
                dt.Rows.Add();
                dt.Rows.Add();
                dt.Rows.Add();
                dt.Rows.Add();
    
                grdNumber.DataSource = dt;
                grdNumber.DataBind();
            }
        }
    
        protected void ddlNumber_SelectedIndexChanged(object sender, EventArgs e)
        {
    
        }
    
        protected void TextBox1_TextChanged(object sender, EventArgs e)
        {
            var value = (sender as TextBox).Text;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a gridview inside an updatepanel. It has a TemplateField column with radiobutton:
I have a problem with this that works for one button and not for
I have a gridview within an updatepanel which allows paging and has a linkbutton
I have an updatepanel in ASP.NET that does a partial page refresh. I've had
I have a GridView in an UpdatePanel (ASP.Net 2.0) . I have this code
I have a GridView inside of a UpdatePanel. In a template field is a
I have a gridview inside an updatepanel and I have a javascript that calls
I have a gridview that is in an updatepanel. The sort works fine when
i have a gridview in updatePanel that i need to update every interval of
I have a GridView inside UpdatePanel and also a HoverMenuExtender declared. GridView also has

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.