Skip to content Skip to sidebar Skip to footer

Force A Postback In Javascript For UpdatePanel?

I have a function to close a modal: function closeModal(name) { $(name).modal('hide'); } But, my page also has an update panel and I need to trigger it. I tried __doPostBack('

Solution 1:

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


Post a Comment for "Force A Postback In Javascript For UpdatePanel?"