Reputation: 428
I would like to open a modal window when i click a button, inside the modal window should load an aspx page with controls and should work (make postbacks, etc).
how can i achive that ?
thanks.
Upvotes: 0
Views: 2001
Reputation: 4067
An easy way of doing this (if you don't need any value exchange between the parent and child window) is to use jquery dialog with an iFrame. Example:
$("<iframe src='Modal.aspx'></iframe>").dialog({
open: function () {
// do something on open
},
// add a close listener to prevent adding multiple divs to the document
close: function (event, ui) {
// remove div with all data and events
dialog.remove();
},
modal: true,
resizable: false,
show: { effect: 'fade', duration: 300 },
hide: { effect: 'fade', duration: 300 },
title: "Modal Page Title goes here",
buttons: //optional
[
{
text: 'Cancel',
click: function () {
dialog.remove();
}
},
{
text: 'OK',
click: function () {
// do something on OK
}
}
}).appendTo("body");
Upvotes: 2
Reputation: 82231
You need to use iframe
inside the modal you are displaying and load you aspx page inside the iframe.
Upvotes: 0