I have a parent.aspx form with a 'btnOpen' button on it . On 'btnOpen' click, I open a Jquery Dialog box which contains a iframe. The iframe 'src' is a child.aspx form. The child form has 'btnOK' button. When I click 'btnOK' button, I want the dialog on
the parent form to close. To do that (on the child form), on 'btnOK' button click, I do the following code:
$(document).ready(function()
{
$("#btnOK").live('click',
function()
{
window.parent.closeIframe();
});
});
The function CloseIframe() is on the parent aspx page and looks like this:
function
closeIframe() {
$("#dialog2").dialog("close");
returnfalse;
}
All works fine, except when there is asynchronous postback, the UI dialog box is never closed. Any suggestions, as to what I doing wrong here?
AnjumNagpal
Member
46 Points
60 Posts
Jquery UI Dialog box doesnot close on asynchronous postback
Feb 24, 2012 02:50 PM|LINK
I have a parent.aspx form with a 'btnOpen' button on it . On 'btnOpen' click, I open a Jquery Dialog box which contains a iframe. The iframe 'src' is a child.aspx form. The child form has 'btnOK' button. When I click 'btnOK' button, I want the dialog on the parent form to close. To do that (on the child form), on 'btnOK' button click, I do the following code:
$(document).ready(function() {
$("#btnOK").live('click', function() {
window.parent.closeIframe();
});
});
The function CloseIframe() is on the parent aspx page and looks like this:
function closeIframe() {
$("#dialog2").dialog("close");
return false;
}
All works fine, except when there is asynchronous postback, the UI dialog box is never closed. Any suggestions, as to what I doing wrong here?