Wednesday, 14 August 2013

Jquery modal close in an UpdatePanel when another field updates

Jquery modal close in an UpdatePanel when another field updates

I have an UpdatePanel with an ASP button inside of it which initiates a
search (in code behind) on the click event. A drop down list then updates
with in the same UpdatePanel with information from the search.
I have configured a JQuery modal dialog box to pop up during the search
time, but I'd like to have it vanish when the dropdown menu is updated
after the search. I'm not sure what (event, ui) I should use for the
close, or if this is the correct way to close it at all.
<script>
$(document).ready(function () {
$("#dialog1").dialog({ autoOpen: false, modal: true, resizable: false,
close: function (event, ui) { } });
$("#<%=btnItemNumSearch.ClientID%>").click(function () {
$("#dialog1").dialog("open");
});
});
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(function () {
$("#dialog1").dialog({ autoOpen: false, modal: true, resizable: false,
close: function (event, ui) { } });
$("#<%=btnItemNumSearch.ClientID%>").click(function () {
$("#dialog1").dialog("open");
});
});

No comments:

Post a Comment