UpdatePanel 中的内容模板

发布于 2024-08-03 00:59:42 字数 1672 浏览 0 评论 0原文

当我尝试将两个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你对谁都笑 2024-08-10 00:59:42

将整个表包裹在更新面板中

Wrap the whole Table in the update panel

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文