使用 asp.net 使用 ToolkitScriptManager 在更新面板中未触发 Textchange 事件

Textchange Event not firing in update panel with ToolkitScriptManager using asp.net

这是我的 aspx 代码

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">    </asp:ToolkitScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
         <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>
   </ContentTemplate>
 <Triggers>
  <asp:AsyncPostBackTrigger ControlID="txt_newPayment" EventName ="TextChanged"/>
 </Triggers>
</asp:UpdatePanel>

问题是这段代码没有触发我的 c#

中的 textchange 事件
 protected void txt_newPayment_TextChanged(object sender, EventArgs e)
     {

     }

看来,您的代码看起来不错,并且为更新面板问题放置了所有必需的标签,但是在 A​​utoPostBack="True"在文本框控件上方。只需将此属性添加到文本框控件它一定会触发事件。

希望对您有所帮助,请分享您的想法或反馈

谢谢 卡尔提克