【问题标题】:anchor tag popup not working inside the update panel锚标记弹出窗口在更新面板中不起作用
【发布时间】:2019-09-14 19:18:18
【问题描述】:

当我在更新面板内使用 href 弹出窗口时,它不会触发点击事件,但在更新面板之外,它可以工作。我正在使用 jquery 弹出窗口。 在这里查看我的代码

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

   <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>

   <asp:Panel ID="personal_panel" runat="server">
     <table>
 <tr class="reason">
   <td>
  <asp:TextBox ID="txt_reasons" runat="server" Visible="False"></asp:TextBox>
  </td>
  </tr>
   <tr>
  <td>
    <asp:ImageButton class="back-img" ID="imgbtn_back" runat="server" ImageUrl="~/images/back-back.png" OnClick="imgbtn_back_Click" onClientclick="submit_hidden()"  />
  </td>
 </tr>
</table>
  <p id="Div1"  style="margin-top: -120px;height: 100px;">
 <a id="popupsubmit" class="trigger_popup_fricc1">Submit</a></p>
                    </asp:Panel>

</ContentTemplate>

 </asp:UpdatePanel>  

这里是弹出窗口的我的 Jquery 代码

                       <script>
            $(window).load(function () {
                $(".trigger_popup_fricc1").click(function () {
                    $('.hover_bkgr_fricc1').show();
                });
                $('.hover_bkgr_fricc1').click(function () {
                    $('.hover_bkgr_fricc1').hide();
                });
                $('.popupCloseButton').click(function () {
                    $('.hover_bkgr_fricc1').hide();
                });
               });

</script>

【问题讨论】:

标签: javascript c# jquery asp.net


【解决方案1】:

尝试使用回发触发器。请参考此链接。

Button click not working inside update panel

希望对您有所帮助。 ?

【讨论】:

  • 如果我仍然无法使用回发触发器,我想使用它作为锚点。
  • 也许 DOM 被刷新了?!你的脚本写在最后,在
猜你喜欢
  • 2015-07-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-08-22
  • 2017-01-09
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多