Force a postback in Javascript for UpdatePanel?

前端 未结 1 1430
面向向阳花
面向向阳花 2020-12-20 07:45

I have a function to close a modal:

function closeModal(name) {
    $(name).modal(\'hide\');
}

But, my page also has an update panel and I

相关标签:
1条回答
  • 2020-12-20 08:44

    One option is to put a hidden button inside your update panel

    <div style="display:none">
      <asp:Button ID="Button2" runat="server" Text="Button" />
    </div>
    

    Then call the following in your script

    document.getElementById('<%=Button2.ClientID%>').click();
    

    The button click will cause a postback.

    You can also look at Page.GetPostBackEventReference

    0 讨论(0)
提交回复
热议问题