Reputation: 857
In my single web application, only the Page_Load(...) event is firing. I've tried using the text change event below (auto generated by double clicking the textbox):
protected void txtBuyerExtension_TextChanged(object sender, EventArgs e)
{
// do something
}
But nothing happens. It does that for every control... the only event that fires is Page_Load. How come it is doing this?
Upvotes: 0
Views: 2253
Reputation: 89
<asp:TextBox ID="txtSearch" CssClass="textbox1" placeholder="Search.." AutoPostBack="true" runat="server"
OnTextChanged="txtSearch_TextChanged"></asp:TextBox>
Upvotes: 0
Reputation: 19598
You need to set the AutoPostBack property to enable TextChange event.
<asp:TextBox ID="txtBuyerExtension" runat="server" OnTextChanged="txtBuyerExtension_TextChanged" AutoPostBack="True"></asp:TextBox>
And once you change the focus from TextBox this event will fire.
Upvotes: 1
Reputation: 3818
Add AutoPostBack="True"
<asp:TextBox ID="txtBuyerExtension" runat="server" OnTextChanged="txtBuyerExtension_TextChanged" AutoPostBack="True"></asp:TextBox>
Upvotes: 2