找不到带有 ID 的 UpdatePanel

发布于 2024-12-05 09:00:02 字数 11219 浏览 1 评论 0原文

我最近将一个项目更新到了 DNN 6.0.1。我从 6.0.1 安装开始,并从那里添加了我的桌面模块。从 5.6.3 迁移到 6.0.1 时,我的一些用户控件中的某些功能出现了问题。在深入探讨之前,我得承认我有点神经病。

快速概述我有一个 ascx,它包含另一个控件中的所有功能,该控件包含 asp 向导中的几个其他控件。
(如此多的嵌套控件的原因是出于许可目的隐藏功能,并且另一个模块[也获得许可]依赖于第一个子控件中的功能)

它就像这样 Parent: ViewReportRisk.ascx >>>子级:ReportRiskWizard.ascx>>第二个子: Attachments.ascx (许可 -- 隐藏功能) (主要功能)(支持功能的控件)

向导(在子控件中)位于 Telerik RadMultiPage 内部。我遇到问题的控件(第二个子控件)包含一个包裹在 asp 更新面板中的 RadUploader。

当我在向导中单击“下一步”以使用 RadUploader 查看控件时,出现此错误:

Sys.InvalidOperationException: Sys.InvalidOperationException: Could not find UpdatePanel with ID 'dnn_ctr445_ViewReportIssue_wzAddRisk_AttachmentsAddTemp_UpdatePanel1'. If it is being updated dynamically then it must be inside another UpdatePanel.' when calling method: [nsIDOMEventListener::handleEvent]

ID 良好。我没有动态创建控件,当我删除更新面板时,控件会出现,但上传功能会丢失。

控件快速概述(缩写):

ViewReportIssue.ascx

    <%@ Control Language="C#" Inherits="NWDS.Modules.ReportIssue.ViewReportIssue" AutoEventWireup="true"
        CodeBehind="ViewReportIssue.ascx.cs" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <%@ Register src="ReportIssueWizard.ascx" tagname="ReportIssueWizard" tagprefix="uc2" %>
    <%@ Register src="../Utils/LicensingInfo.ascx" tagname="LicensingInfo" tagprefix="uc1" %>

    <uc1:LicensingInfo ID="LicensingInfo1" runat="server" />

    <asp:Panel runat="server" ID="pnlContainer">
        <uc2:ReportIssueWizard ID="ReportIssueWizard1" runat="server" />   
    </asp:Panel>

ReportIssueWizard.ascx

<%@ Register Src="Attachments.ascx" TagName="Attachments" TagPrefix="nwds" %>
<%@ Register Src="NonPunitiveReportingPolicy.ascx" TagName="NonPunitiveReportingPolicy"
    TagPrefix="nwds" %>
<%@ Register Src="DescriptionCorrectiveAction.ascx" TagName="DescriptionCorrectiveAction"
    TagPrefix="nwds" %>
<%@ Register Src="ThankYou.ascx" TagName="ThankYou" TagPrefix="nwds" %>
<%@ Register Src="SelectDivisionTypeCustomType.ascx" TagName="SelectDivisionTypeCustomType"
    TagPrefix="nwds" %>
<%@ Register Src="IssuePeopleInvolved.ascx" TagName="IssuePeopleInvolved" TagPrefix="nwds" %>
<%@ Register Src="WhereWhen.ascx" TagName="WhereWhen" TagPrefix="nwds" %>
<%@ Register Src="CustomATC.ascx" TagName="ATC" TagPrefix="customReport" %>
<%@ Register Src="CustomCabinSafety.ascx" TagName="Cabin" TagPrefix="customReport" %>
<%@ Register Src="CustomFlightSafety.ascx" TagName="Flight" TagPrefix="customReport" %>
<%@ Register Src="CustomMaintenance.ascx" TagName="Maintenance" TagPrefix="customReport" %>
<%@ Register Src="ReportRiskViewMode.ascx" TagName="ViewMode" TagPrefix="nwds" %>
<%@ Register Src="CustomParamedic.ascx" TagName="CustomParamedic" TagPrefix="nwds" %>
<%@ Register Src="QuickReport.ascx" TagName="QuickReport" TagPrefix="nwds" %>
<%@ Register Src="../Utils/GlobalMessage.ascx" TagName="GlobalMessage" TagPrefix="nwds" %>


<telerik:RadTabStrip ID="tsMenu" runat="server" MultiPageID="mpvMain" Skin="Telerik"
                    AutoPostBack="True" SelectedIndex="0" OnTabClick="tsMenu_TabClick">
                    </telerik:RadTabStrip>
                    <telerik:RadMultiPage ID="mpvMain" runat="server" RenderSelectedPageOnly="True" SelectedIndex="0"
    Width="100%">
    <telerik:RadPageView runat="server" ID="pvReport">
        <div id="forcer" runat="server">
            <asp:Label ID="lblWarning" CssClass="Warning" runat="server"></asp:Label>
            <asp:MultiView ID="mvReportRisk" runat="server">
                <asp:View ID="vBasicDetails" runat="server">
                    <asp:Wizard ID="wzAddRisk" runat="server" Width="1000px" OnActiveStepChanged="wzAddRisk_ActiveStepChanged"
                        OnNextButtonClick="ChangeHeaderNext" OnPreviousButtonClick="ChangeHeaderPrevious"
                        OnFinishButtonClick="wzAddRisk_FinishButtonClick" ActiveStepIndex="0">                      
                     <WizardSteps>
                        <asp:WizardStep ..........

                         <asp:WizardStep ID="Attachments" runat="server" Title="7. Add Attachments">

                                <nwds:Attachments ID="AttachmentsAddTemp" runat="server" CanAddNewAttachments="true"
                                    UserCanEdit="true" attachmentType="Temp" />

                        </asp:WizardStep>
                         </WizardSteps>
                    <FinishNavigationTemplate>
                        <table width="100%" class="formBg">
                            <tr>
                                <td align="left" valign="top">
                                    <asp:Button ID="btnPrevious" runat="server" CssClass="Button" Text="Previous" OnClick="ChangeHeaderPrevious" />
                                </td>
                                <td align="right" valign="top">
                                    <asp:Button ID="btnSubmitIssue" runat="server" CssClass="Button" Text="Submit" OnClick="btnSubmitIssue_Click" />
                                </td>
                            </tr>
                        </table>
                    </FinishNavigationTemplate>
                    <StepNavigationTemplate>
                        <table width="100%" class="formBg">
                            <tr>
                                <td>
                                    <div style="padding-top: 0px; text-align: left;">
                                        <asp:Button ID="btnPrevious" runat="server" CssClass="Button" Text="Previous" OnClick="ChangeHeaderPrevious" />
                                    </div>
                                </td>
                                <td>
                                    <div style="padding-top: 0px; text-align: right;">
                                        <asp:Button ID="Button2" runat="server" CssClass="Button" Text="Next" OnClick="ChangeHeaderNext" />
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </StepNavigationTemplate>
                    <HeaderStyle CssClass="formHeadingSub" />
                    <SideBarTemplate>
                        <asp:DataList ID="SideBarList" runat="server">
                            <SelectedItemStyle Font-Bold="True" />
                            <ItemTemplate>
                                <asp:LinkButton ForeColor="Black" ID="SideBarButton" runat="server" Font-Size="1em"
                                    OnClick="ChangeHeader" BackColor="transparent" Font-Underline="True" Font-Bold="true"></asp:LinkButton>
                            </ItemTemplate>
                            <SelectedItemTemplate>
                                <asp:LinkButton ID="SideBarButton" OnClick="ChangeHeader" runat="server" BackColor="#e4e4e4"
                                    ForeColor="Black" Font-Bold="true" Font-Underline="True" Font-Size="1em"></asp:LinkButton>
                            </SelectedItemTemplate>
                        </asp:DataList>
                    </SideBarTemplate>
                </asp:Wizard>
                <br />
                <div class="">
                    <strong>Note: </strong>For best results, do not use the browser back button. Use
                    either the "Previous" button or the side menu to navigate.
                </div>
            </asp:View>
        </asp:MultiView>
            </div>
</telerik:RadPageView>

Attachments.ascx

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Attachments.ascx.cs" Inherits="NWDS.Modules.ReportIssue.Attachments" %>
    <%@ Register Src="../Utils/GlobalMessage.ascx" TagName="GlobalMessage" TagPrefix="nwds" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <style type="text/css">
        ul li
        {
            list-style: none;
        }
    </style>
    <div>

      <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <telerik:radgrid id="gvAttachments" width="50%" skin="Default" runat="server" autogeneratecolumns="False"
                    allowautomaticdeletes="True" allowautomaticupdates="True" gridlines="None"
                    ondeletecommand="gv_DeleteCommand" datasourceid="odsAttachments" visible="False"
                    onitemdatabound="gv_ItemDataBound">
                </telerik:radgrid>
                <telerik:radgrid id="gvTemp" width="50%" skin="Default" runat="server" autogeneratecolumns="False"
                    allowautomaticupdates="True" gridlines="None" datasourceid="odsTempFiles" visible="false" ondeletecommand="gv_DeleteCommand"
                    onitemdatabound="gv_ItemDataBound"> 
                 </telerik:radgrid>
                <telerik:radgrid id="gvNonReportedIssueRelatedAttachments" width="50%" skin="Default" runat="server"
                    autogeneratecolumns="False" allowautomaticupdates="True"
                    gridlines="None" datasourceid="odsNonReportedIssueRelatedAttachments"
                    visible="false" ondeletecommand="gv_DeleteCommand" onitemdatabound="gv_ItemDataBound">
                </telerik:radgrid>
                <br />  

                <telerik:radupload id="ruIssueAttachments" runat="server" onfileexists="ruIssueAttachments_FileExists"
                    allowedfileextensions="tiff,jpg,jpeg,png,gif,bmp,doc,docx,xls,xlsx,pdf,txt" controlobjectsvisibility="None"
                    initialfileinputscount="10">
                </telerik:radupload>

                <div style="padding-bottom: 15px;">
                    <asp:Button ID="btnUploadAttachments" runat="server" Text="Upload" CssClass="Button"
                        OnClick="UploadFiles" />
                        &nbsp;&nbsp;&nbsp;&nbsp;<asp:Label id="lblUploadWarning" runat="server"  style="font-weight: bold; color: Red;">To add the attachment, click the Upload Button</asp:Label></div></div>
            </ContentTemplate>
            <Triggers>
                <asp:PostBackTrigger ControlID="btnUploadAttachments" />
            </Triggers>
     </asp:UpdatePanel>     

这在 DNN 5.6.3 版本中没有发生,仅在 6.0.1 中发生(模块中的相同代码)
只是对于 S&GI 在另一个第二个子控件上放置了一个更新面板,它引发了相同的错误,所以我确信它与控件的嵌套(父子-孙子)有关,但我不确定如何补救这个问题。

非常感谢任何帮助,提前致谢。

I have recently updated a project to DNN 6.0.1. I started with the 6.0.1 install and added my desktop modules from there. A problem has occured in the move from 5.6.3 to 6.0.1 with some functionality in a few of my user controls. Before I get too in-depth I will admit I am a bit of a nube.

A quick overview I have an ascx that contains all of it's functionality in another control that contains several other controls within an asp wizard.
(the reason for so many nested controls is hiding functionality for licensing purposes and the fact that another module [also licensed] relies on the functionality in the first-child control)

It goes like this Parent: ViewReportRisk.ascx >> Child: ReportRiskWizard.ascx >> Second-Child: Attachments.ascx
(licensing -- hide functinality) (Main Functionality) (controls that support functionality)

The wizard (in child control) is inside of a Telerik RadMultiPage. The control (second-child control)that I am having the trouble with contains a RadUploader wrapped in an asp Update Panel.

When I click "Next" in the wizard to view the control with the RadUploader, I am getting this error:

Sys.InvalidOperationException: Sys.InvalidOperationException: Could not find UpdatePanel with ID 'dnn_ctr445_ViewReportIssue_wzAddRisk_AttachmentsAddTemp_UpdatePanel1'. If it is being updated dynamically then it must be inside another UpdatePanel.' when calling method: [nsIDOMEventListener::handleEvent]

The Id is good. I am not dynamically creating the control, and when I remove the update panel, the control appears, but the upload functionality is lost.

A quick overview of controls (abbreviated):

ViewReportIssue.ascx

    <%@ Control Language="C#" Inherits="NWDS.Modules.ReportIssue.ViewReportIssue" AutoEventWireup="true"
        CodeBehind="ViewReportIssue.ascx.cs" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <%@ Register src="ReportIssueWizard.ascx" tagname="ReportIssueWizard" tagprefix="uc2" %>
    <%@ Register src="../Utils/LicensingInfo.ascx" tagname="LicensingInfo" tagprefix="uc1" %>

    <uc1:LicensingInfo ID="LicensingInfo1" runat="server" />

    <asp:Panel runat="server" ID="pnlContainer">
        <uc2:ReportIssueWizard ID="ReportIssueWizard1" runat="server" />   
    </asp:Panel>

ReportIssueWizard.ascx

<%@ Register Src="Attachments.ascx" TagName="Attachments" TagPrefix="nwds" %>
<%@ Register Src="NonPunitiveReportingPolicy.ascx" TagName="NonPunitiveReportingPolicy"
    TagPrefix="nwds" %>
<%@ Register Src="DescriptionCorrectiveAction.ascx" TagName="DescriptionCorrectiveAction"
    TagPrefix="nwds" %>
<%@ Register Src="ThankYou.ascx" TagName="ThankYou" TagPrefix="nwds" %>
<%@ Register Src="SelectDivisionTypeCustomType.ascx" TagName="SelectDivisionTypeCustomType"
    TagPrefix="nwds" %>
<%@ Register Src="IssuePeopleInvolved.ascx" TagName="IssuePeopleInvolved" TagPrefix="nwds" %>
<%@ Register Src="WhereWhen.ascx" TagName="WhereWhen" TagPrefix="nwds" %>
<%@ Register Src="CustomATC.ascx" TagName="ATC" TagPrefix="customReport" %>
<%@ Register Src="CustomCabinSafety.ascx" TagName="Cabin" TagPrefix="customReport" %>
<%@ Register Src="CustomFlightSafety.ascx" TagName="Flight" TagPrefix="customReport" %>
<%@ Register Src="CustomMaintenance.ascx" TagName="Maintenance" TagPrefix="customReport" %>
<%@ Register Src="ReportRiskViewMode.ascx" TagName="ViewMode" TagPrefix="nwds" %>
<%@ Register Src="CustomParamedic.ascx" TagName="CustomParamedic" TagPrefix="nwds" %>
<%@ Register Src="QuickReport.ascx" TagName="QuickReport" TagPrefix="nwds" %>
<%@ Register Src="../Utils/GlobalMessage.ascx" TagName="GlobalMessage" TagPrefix="nwds" %>


<telerik:RadTabStrip ID="tsMenu" runat="server" MultiPageID="mpvMain" Skin="Telerik"
                    AutoPostBack="True" SelectedIndex="0" OnTabClick="tsMenu_TabClick">
                    </telerik:RadTabStrip>
                    <telerik:RadMultiPage ID="mpvMain" runat="server" RenderSelectedPageOnly="True" SelectedIndex="0"
    Width="100%">
    <telerik:RadPageView runat="server" ID="pvReport">
        <div id="forcer" runat="server">
            <asp:Label ID="lblWarning" CssClass="Warning" runat="server"></asp:Label>
            <asp:MultiView ID="mvReportRisk" runat="server">
                <asp:View ID="vBasicDetails" runat="server">
                    <asp:Wizard ID="wzAddRisk" runat="server" Width="1000px" OnActiveStepChanged="wzAddRisk_ActiveStepChanged"
                        OnNextButtonClick="ChangeHeaderNext" OnPreviousButtonClick="ChangeHeaderPrevious"
                        OnFinishButtonClick="wzAddRisk_FinishButtonClick" ActiveStepIndex="0">                      
                     <WizardSteps>
                        <asp:WizardStep ..........

                         <asp:WizardStep ID="Attachments" runat="server" Title="7. Add Attachments">

                                <nwds:Attachments ID="AttachmentsAddTemp" runat="server" CanAddNewAttachments="true"
                                    UserCanEdit="true" attachmentType="Temp" />

                        </asp:WizardStep>
                         </WizardSteps>
                    <FinishNavigationTemplate>
                        <table width="100%" class="formBg">
                            <tr>
                                <td align="left" valign="top">
                                    <asp:Button ID="btnPrevious" runat="server" CssClass="Button" Text="Previous" OnClick="ChangeHeaderPrevious" />
                                </td>
                                <td align="right" valign="top">
                                    <asp:Button ID="btnSubmitIssue" runat="server" CssClass="Button" Text="Submit" OnClick="btnSubmitIssue_Click" />
                                </td>
                            </tr>
                        </table>
                    </FinishNavigationTemplate>
                    <StepNavigationTemplate>
                        <table width="100%" class="formBg">
                            <tr>
                                <td>
                                    <div style="padding-top: 0px; text-align: left;">
                                        <asp:Button ID="btnPrevious" runat="server" CssClass="Button" Text="Previous" OnClick="ChangeHeaderPrevious" />
                                    </div>
                                </td>
                                <td>
                                    <div style="padding-top: 0px; text-align: right;">
                                        <asp:Button ID="Button2" runat="server" CssClass="Button" Text="Next" OnClick="ChangeHeaderNext" />
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </StepNavigationTemplate>
                    <HeaderStyle CssClass="formHeadingSub" />
                    <SideBarTemplate>
                        <asp:DataList ID="SideBarList" runat="server">
                            <SelectedItemStyle Font-Bold="True" />
                            <ItemTemplate>
                                <asp:LinkButton ForeColor="Black" ID="SideBarButton" runat="server" Font-Size="1em"
                                    OnClick="ChangeHeader" BackColor="transparent" Font-Underline="True" Font-Bold="true"></asp:LinkButton>
                            </ItemTemplate>
                            <SelectedItemTemplate>
                                <asp:LinkButton ID="SideBarButton" OnClick="ChangeHeader" runat="server" BackColor="#e4e4e4"
                                    ForeColor="Black" Font-Bold="true" Font-Underline="True" Font-Size="1em"></asp:LinkButton>
                            </SelectedItemTemplate>
                        </asp:DataList>
                    </SideBarTemplate>
                </asp:Wizard>
                <br />
                <div class="">
                    <strong>Note: </strong>For best results, do not use the browser back button. Use
                    either the "Previous" button or the side menu to navigate.
                </div>
            </asp:View>
        </asp:MultiView>
            </div>
</telerik:RadPageView>

Attachments.ascx

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Attachments.ascx.cs" Inherits="NWDS.Modules.ReportIssue.Attachments" %>
    <%@ Register Src="../Utils/GlobalMessage.ascx" TagName="GlobalMessage" TagPrefix="nwds" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <style type="text/css">
        ul li
        {
            list-style: none;
        }
    </style>
    <div>

      <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <telerik:radgrid id="gvAttachments" width="50%" skin="Default" runat="server" autogeneratecolumns="False"
                    allowautomaticdeletes="True" allowautomaticupdates="True" gridlines="None"
                    ondeletecommand="gv_DeleteCommand" datasourceid="odsAttachments" visible="False"
                    onitemdatabound="gv_ItemDataBound">
                </telerik:radgrid>
                <telerik:radgrid id="gvTemp" width="50%" skin="Default" runat="server" autogeneratecolumns="False"
                    allowautomaticupdates="True" gridlines="None" datasourceid="odsTempFiles" visible="false" ondeletecommand="gv_DeleteCommand"
                    onitemdatabound="gv_ItemDataBound"> 
                 </telerik:radgrid>
                <telerik:radgrid id="gvNonReportedIssueRelatedAttachments" width="50%" skin="Default" runat="server"
                    autogeneratecolumns="False" allowautomaticupdates="True"
                    gridlines="None" datasourceid="odsNonReportedIssueRelatedAttachments"
                    visible="false" ondeletecommand="gv_DeleteCommand" onitemdatabound="gv_ItemDataBound">
                </telerik:radgrid>
                <br />  

                <telerik:radupload id="ruIssueAttachments" runat="server" onfileexists="ruIssueAttachments_FileExists"
                    allowedfileextensions="tiff,jpg,jpeg,png,gif,bmp,doc,docx,xls,xlsx,pdf,txt" controlobjectsvisibility="None"
                    initialfileinputscount="10">
                </telerik:radupload>

                <div style="padding-bottom: 15px;">
                    <asp:Button ID="btnUploadAttachments" runat="server" Text="Upload" CssClass="Button"
                        OnClick="UploadFiles" />
                            <asp:Label id="lblUploadWarning" runat="server"  style="font-weight: bold; color: Red;">To add the attachment, click the Upload Button</asp:Label></div></div>
            </ContentTemplate>
            <Triggers>
                <asp:PostBackTrigger ControlID="btnUploadAttachments" />
            </Triggers>
     </asp:UpdatePanel>     

This didn't occur in the DNN 5.6.3 build, only in 6.0.1 (same code in the module)
Just for S&G I placed an update panel on another second-child control and it threw the same error, so I am certain it has something to do with the nesting of the controls (Parent-Child-GrandChild), but I am unsure of how to remedy this.

Any help is greatly appreciated, thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

虚拟世界 2024-12-12 09:00:02

事实证明,我的问题的答案是将 UpdatePanel 的 UpdateMode 属性设置为 Conditional

Well as it turns out, the answer to my problem is setting the UpdateMode property of the UpdatePanel to Conditional

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