Click here to Skip to main content
15,892,575 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am opening a Child Modal Dialog window from my parent webpage.The javascript code for opening the Dialog is as follows:-
JavaScript
function openmodalWin() {
        window.showModalDialog("ClockPopUP.aspx", "Clock", "dialogWidth:550px;dialogHeight:350px,");
        }

The Asp Code is as Follows:-
ASP.NET
<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 it is very urgent and if possible please share the code snippet also and i m not so good in javascript.
Thanks in advanse and waiting for all your's kind response.
Posted

1 solution

set following function on your body tag


HTML
<body onbeforeunload="return returTime()">
</body>


and add a javascript function on your page

JavaScript
function returTime()
{
var closeTime;//assign this variable with jQuery Clock

 window.returnValue=closeTime

}
 
Share this answer
 
Comments
Dharmenrda Kumar Singh 29-May-12 8:05am    
Thanks, its working.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900