Denver Denver - 1 year ago 85
ASP.NET (C#) Question

Textchange Event not firing in update panel with ToolkitScriptManager using

here is my aspx code

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> </asp:ToolkitScriptManager>

<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<asp:TextBox ID="txt_newPayment" runat="server" Style="text-align: center" onblur="if(this.value=='')this.value=this.defaultValue;" value="0" onfocus="if(this.value==this.defaultValue)this.value='';" class="form-control"
Font-Bold="True" Font-Size="XX-Large" Height="50px" ontextchanged="txt_newPayment_TextChanged">0</asp:TextBox>
<asp:Label ID="Label5" runat="server" Text="Change: " Style="text-align: center;
font-size: 20px; color: black" Font-Bold="True"></asp:Label>
<asp:Label ID="lblChange" runat="server" Text="N/A" Style="text-align: center; font-size: 20px; color: green" Font-Bold="True"></asp:Label>
<asp:AsyncPostBackTrigger ControlID="txt_newPayment" EventName ="TextChanged"/>

the very problem is this code is not firing the textchange event in my c#

protected void txt_newPayment_TextChanged(object sender, EventArgs e)


Answer Source

It seems that, your code looks good and all the required tags were placed for update panel issue, but one small problem AutoPostBack="True" was missed in the above Textbox control. Just add this attributes to the textbox control it will surely trigger the event.

Hope it was useful,kindly share your thoughts or feedbacks

thanks karthik

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download