ASP.NET UpdatePanel仅触发一次异步更新且页面出现第三方元素异常问题求助
ASP.NET UpdatePanel仅触发一次异步更新且页面出现第三方元素异常问题求助
各位大佬好,我最近碰到一个头疼的ASP.NET问题,想请大家帮忙排查下:
我在页面上放了一个<asp:UpdatePanel>,但它只能正常工作一次,而且每次触发更新后页面还会冒出一些第三方元素,完全不符合预期。
具体场景是这样的:当我修改tbName文本框的内容时,本应该触发upProductVariations里的自定义控件<iLightSite:ProductVariations>异步更新,但现在只有第一次修改能成功触发,之后再改文本框就没反应了,同时页面还会出现异常的第三方元素(就像截图里显示的那样)。
下面是相关的代码片段:
<div class="field-section-row" style="padding-top: 0; padding-bottom: 0"> <div class="field-section"> <asp:Label ID="lName" runat="server" Text="#Name#" meta:resourcekey="lName" CssClass="field-label"></asp:Label> <asp:TextBox ID="tbName" CssClass="form-control" runat="server" xStringMaxLength="180" OnTextChanged="tbName_TextChanged" AutoPostBack="true" MaxLength="180"></asp:TextBox> <!-- 省略其他代码 --> </div> </div> <div class="field-section-row" style="padding-top: 0; padding-bottom: 0"> <asp:UpdatePanel runat="server" ID="upProductVariations" UpdateMode="Conditional"> <ContentTemplate> <iLightSite:ProductVariations ID="productVariations" runat="server"></iLightSite:ProductVariations> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="tbName" EventName="TextChanged" /> </Triggers> </asp:UpdatePanel> </div>
我已经尝试过这些方法,但都没解决问题:
- 把UpdatePanel挪到页面的不同位置
- 谷歌搜索相关问题,也咨询过ChatGPT
但每次触发一次更新后,还是会出现那个异常,之后就再也触发不了异步更新了。有没有大佬遇到过类似的情况?求指点!
备注:内容来源于stack exchange,提问作者Dmytro
相关产品推荐
相关产品推荐

