简体   繁体   English

面板未显示在 UpdatePanel 中

[英]Panel not displayed in UpdatePanel

<form runat="server" id="from1">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <script src='https://www.google.com/recaptcha/api.js'></script>

            <asp:Panel runat="server" ID="pnlSiteQuestions">
                >>>>> CONTROLS removed for brevity <<<<<
                <asp:Button ID="btnContinue" runat="server" Text="Continue" OnClick="btnContinue_Click" ValidationGroup="Questions" />
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>

    <asp:Panel ID="pnlNotRequired" runat="server" Visible="false">
        Sorry you do not qualify.
    </asp:Panel>

    <asp:Panel runat="server" ID="pnlAdditionalDetails" Visible="false">
                    <asp:ValidationSummary runat="server" ID="ValidationSummary1" />
                        Name
                        <asp:RequiredFieldValidator runat="server" ID="ValidatorName" ControlToValidate="ContactFormNameTextBox" ErrorMessage="Name is required" CssClass="ErrorClass">Required</asp:RequiredFieldValidator>

                        <asp:TextBox runat="server" ID="txtName" />

                            <div class="g-recaptcha" data-sitekey="ABC123"></div>
                        <asp:Button runat="server" ID="button1" Text="Confirm" OnClick="button1_Click" />
            </asp:Panel>

</form>

I have the above form and decided to add an update panel.我有上面的表格,并决定添加一个更新面板。 When a user clicks Continue, it goes to a database and determines if the user qualifies.当用户单击继续时,它会转到数据库并确定用户是否符合条件。 If not pnlNotRequired message is displayed otherwise pnlAdditionalDetails is displayed.如果不是 pnlNotRequired 则显示消息,否则显示 pnlAdditionalDetails。

Everything is/was working until i added the update panel.在我添加更新面板之前,一切都在工作。 So removing the UP has everything working.因此,删除 UP 后一切正常。

I tried adding a trigger but i didnt fully understand how it should be configured as i dont completely understand why this is occurring?我尝试添加一个trigger ,但我不完全理解它应该如何配置,因为我不完全理解为什么会发生这种情况?

No Javascript errors listed either.也没有列出 Javascript 错误。 Anyway to overcome this issue?无论如何要克服这个问题?

Update panel should cover all panels.更新面板应覆盖所有面板。 Add property to update panel "UpdateMode='Conditional'" than add trigger block将属性添加到更新面板“UpdateMode='Conditional'”而不是添加触发块

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM