I have this code in my Master page.
PopUpWindow = function (titles, message) {
document.getElementById('window').innerHTML = message;
$("#window").dialog({
resizable: true,
height: 140,
title: titles,
width: 500,
message: "something here",
modal: true,
buttons: {
"Close": function () {
$(this).dialog("close");
}
}
});
};
<div id="window" style="display: none;">
</div>
I can able to display the popup mesage perfectly..
My questions is..
I have this code in my controller.
return new JavaScriptResult() { Script = "alert('saved Successfully Added. Thank You.'); window.location='/ObnCategory/Index';" };
I changed the code to
return new JavaScriptResult() { Script = "PopUpWindow("saved","something here"); window.location='/ObnCategory/Index';" };
Here I am getting the popup perfectly but the problem is the popup closing automatically without clicing close button. due to window.location?
can any body tell me how to load the page after close button click..
PopupWindow is generic I can not keep window.location on popupwindow script?
thanks
Put the
window.locationin the close handler…Then