Force a postback in Javascript for UpdatePanel?

前端 未结 1 1433
面向向阳花
面向向阳花 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

    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)
提交回复
热议问题