UpdatePanel 中的内容模板
当我尝试将两个 td 定义包含在一个 UpdatePanel 内的一个内容模板中时,出现以下错误: 错误:Sys.InvalidOperationException:找不到 ID 为“ctl00_schoolAdmin_UpdatePanelSchoolAddress”的 UpdatePanel。如果它是动态更新的,那么它必须在另一个 updatepanel 中'“
我现在必须将 td 分成两个更新面板(如下所示),有没有办法避免这种情况?
<tr>
<td style="width: 180px">
<!-- Update panel to show School Address Header -->
<asp:UpdatePanel ID="UpdatePanelSchoolAddressHeader" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="frmSchoolAddressHeader" runat="server" Text="Address" Visible="false"></asp:Label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="SchoolLEADropDownList" />
<asp:AsyncPostBackTrigger ControlID="FindSchoolIDButton" />
</Triggers>
</asp:UpdatePanel>
</td>
<!-- Update panel to show School Address Text -->
<td style="width: 300px">
<asp:UpdatePanel ID="UpdatePanelSchoolAddress" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="frmSchoolAddressText" runat="server" Visible="false"> </asp:Label>
</td>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="SchoolLEADropDownList" />
<asp:AsyncPostBackTrigger ControlID="FindSchoolIDButton" />
</Triggers>
</asp:UpdatePanel>
</td>
</tr>
非常感谢
When I try to include both td definitions in one content template within one UpdatePanel I get the error below:
Error:Sys.InvalidOperationException: Could not find UpdatePanel with ID 'ctl00_schoolAdmin_UpdatePanelSchoolAddress'. If it is being updated dynamically then it must be inside another updatepanel' "
I have had to now split the td into two update panels (as below), is there a way to avoid this?
<tr>
<td style="width: 180px">
<!-- Update panel to show School Address Header -->
<asp:UpdatePanel ID="UpdatePanelSchoolAddressHeader" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="frmSchoolAddressHeader" runat="server" Text="Address" Visible="false"></asp:Label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="SchoolLEADropDownList" />
<asp:AsyncPostBackTrigger ControlID="FindSchoolIDButton" />
</Triggers>
</asp:UpdatePanel>
</td>
<!-- Update panel to show School Address Text -->
<td style="width: 300px">
<asp:UpdatePanel ID="UpdatePanelSchoolAddress" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="frmSchoolAddressText" runat="server" Visible="false"> </asp:Label>
</td>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="SchoolLEADropDownList" />
<asp:AsyncPostBackTrigger ControlID="FindSchoolIDButton" />
</Triggers>
</asp:UpdatePanel>
</td>
</tr>
Thanks very much
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将整个表包裹在更新面板中
Wrap the whole Table in the update panel