I am opening a Child Modal Dialog window from my parent web page. The JavaScript code for opening the Dialog is as follows:-
function openmodalWin() {
window.showModalDialog("ClockPopUP.aspx", "Clock", "dialogWidth:550px;dialogHeight:350px,");
}
The Asp Code is as Follows:-
<asp:Button ID="Button1" runat="server" Text="Lunch" CausesValidation="false" CssClass="bigbuttons" style="background:url(../App_Themes/Images/green-box.gif)" Font-Bold="True" ForeColor="White" Font-Size="Large" OnClientClick="openmodalWin(); return false;"
In my "ClockPopUp.aspx" I had used only one jQuery stop watch plugin which is just for showing purpose and no use except it. My requirement is that I want that as the user will close the ModalDialog, on the parent page we can capture the time when the Pop up will be closed, or the ShowmodalDialog will return datetime at window.close().
Please try to solve this issue as I’m not so good in JavaScript.
jQuery UI has this functionality without the need to access another aspx page.
However, window.showModalDialog returns a value, so you’d need to alter your aspx to return something meaningful i.e.
window.returnValue = “whatever”;
window.close();
Then you can call it using