0

Web.UI.Controls.TextBox

in my aspx page i have used-

<asp:TextBox ID="TextBox1" runat="server"  OnTextChanged="tmaintextchanged"  ></asp:TextBox>

in my code behind :

<asp:Label ID="show" runat="server" ></asp:Label >

protected void tmaintextchanged(object sender, EventArgs e)
        {
            show.Text = "working";
        }

when I am executing this ,Why is the text of label "show" not changing.Kindly help. Am i missing any configuration to the Text box.

Ravi Gadag
  • 15,735
  • 5
  • 57
  • 83
user2074474
  • 23
  • 1
  • 6
  • Are you using any update panels? Did you put a breakpoint in the tmaintextchanged method to make sure it's being called? – Blachshma Feb 18 '13 at 11:00

1 Answers1

0

You need to set autopostback on TextBox control:

<asp:TextBox ID="TextBox1" runat="server" AutoPostBack="true" OnTextChanged="tmaintextchanged"  ></asp:TextBox>

Update

see this post:

How do I make a Textbox Postback on KeyUp?

Community
  • 1
  • 1
RedDevil79
  • 445
  • 5
  • 13